Selaa lähdekoodia

Merge branch 'master' of https://gitee.com/antai-wuliu/ANTAI-API

liyg 1 vuosi sitten
vanhempi
commit
2af7f26cf9

+ 43 - 0
src/main/java/com/steerinfo/dil/controller/WebSocketController.java

@@ -0,0 +1,43 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.feign.WebSocketFeign;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageList;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @ClassName WebSocketController
+ * @Description TODO
+ * @date 2024-02-27 10:22
+ * @Version 1.0
+ */
+@RequestMapping("${api.version}/websocket")
+@RestController
+public class WebSocketController {
+    @Autowired
+    WebSocketFeign webSocketFeign;
+    @PostMapping("/readWebsocket/{id}")
+    public RESTfulResult readWebsocket(@PathVariable("id") String sendId){
+        return webSocketFeign.readWebsocket(sendId);
+    }
+
+    @PostMapping("/sendWebsocket/{id}")
+    public RESTfulResult sendWebsocket(@PathVariable("id") String webSocketId, @RequestBody HashMap<String,Object> map, HttpServletRequest request){
+        return webSocketFeign.sendWebsocket(webSocketId,map);
+    }
+
+    @GetMapping(value = "/")
+    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        return webSocketFeign.list(parmas, pageNum, pageSize);
+    }
+
+    @GetMapping("/getMessageCount/{id}")
+    public RESTfulResult getMessageCount(@PathVariable String id,@RequestParam()String readFlag){
+        return webSocketFeign.getMessageCount(id,readFlag);
+    }
+}

+ 28 - 0
src/main/java/com/steerinfo/dil/feign/WebSocketFeign.java

@@ -0,0 +1,28 @@
+package com.steerinfo.dil.feign;
+
+import com.steerinfo.framework.controller.RESTfulResult;
+import io.swagger.annotations.ApiImplicitParam;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+/**
+ * @ClassName WebSocketFeign
+ * @Description TODO
+ * @date 2024-02-27 9:31
+ * @Version 1.0
+ */
+
+@FeignClient(name = "WEBSOCKET-API", url = "${openfeign.WebSocketFeign.url}")
+public interface WebSocketFeign {
+    @PostMapping("api/v1/websocket/basewebsocketsends/readWebsocket/{id}")
+    RESTfulResult readWebsocket(@PathVariable("id") String sendId);
+
+    @PostMapping("api/v1/websocket/basewebsocketsends/sendWebsocket/{id}")
+    RESTfulResult sendWebsocket(@PathVariable("id") String webSocketId, @RequestBody HashMap<String,Object> map);
+    @GetMapping("api/v1/websocket/basewebsocketsends/")
+    RESTfulResult list(@RequestParam("parmas")HashMap<String,Object> parmas,@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize);
+    @GetMapping("api/v1/websocket/basewebsocketsends/getMessageCount/{id}")
+    RESTfulResult getMessageCount(@PathVariable String id,@RequestParam()String readFlag);
+}

+ 2 - 0
src/main/resources/application-dev.yml

@@ -58,6 +58,8 @@ openfeign:
     url: ${OTMSFEIGN_URL:localhost:8038}
   EmsFeign:
     url: ${TMSFEIGN_URL:localhost:8096}
+  WebSocketFeign:
+    url: ${WEBSOCKETFEIGN_URL:localhost:8000}
   SSOFeign:
     url: ${SSOFEIGN_URL:172.16.90.214:9001}
 

+ 2 - 0
src/main/resources/application-prod.yml

@@ -45,6 +45,8 @@ openfeign:
     url: ${TMSFEIGN_URL:172.16.90.214:8096}
   SSOFeign:
     url: ${SSOFEIGN_URL:172.16.90.214:9001}
+  WebSocketFeign:
+    url: ${WEBSOCKETFEIGN_URL:localhost:8000}
 
 
 #远程调用