|
@@ -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);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|