|
@@ -3,10 +3,15 @@ package com.izouma.meta.web;
|
|
|
import com.izouma.meta.dto.MetaRestResult;
|
|
import com.izouma.meta.dto.MetaRestResult;
|
|
|
import com.izouma.meta.websocket.MMOWebSocket;
|
|
import com.izouma.meta.websocket.MMOWebSocket;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
|
+import java.util.concurrent.ScheduledExecutorService;
|
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
+
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/metaCacheable")
|
|
@RequestMapping("/metaCacheable")
|
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
@@ -18,4 +23,10 @@ public class MetaCacheable {
|
|
|
public MetaRestResult<Void> clearMMO(String userId, String regionId, String cityId) {
|
|
public MetaRestResult<Void> clearMMO(String userId, String regionId, String cityId) {
|
|
|
return mmoWebSocket.clearMMO(userId, regionId, cityId);
|
|
return mmoWebSocket.clearMMO(userId, regionId, cityId);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/run")
|
|
|
|
|
+ public void test() {
|
|
|
|
|
+ ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
|
|
|
|
|
+ executor.scheduleAtFixedRate(() -> mmoWebSocket.onMessage("metaRobot", "7970191", "{type:9}", null), 0, 1000, TimeUnit.MILLISECONDS);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|