燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-11-06 52e6812c5cf6d139ae183afff976029c50adf4b4
src/main/java/com/yssh/controller/SuYuanController.java
@@ -3,6 +3,7 @@
import cn.hutool.core.date.DateTime;
import com.yssh.entity.*;
import com.yssh.service.CommonService;
import com.yssh.service.SocketService;
import com.yssh.service.VocValsService;
import com.yssh.utils.DateUtils;
import com.yssh.utils.StringUtils;
@@ -46,6 +47,9 @@
    @Resource
    private VocValsService vocValsService;
    @Resource
    private SocketService socketService;
    private final static SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH");
@@ -214,4 +218,19 @@
        return Result.OK(suYuanService.selectFastById(id, date));
    }
    @ApiOperation(value = "发送消息")
    @ApiOperationSupport(order = 19)
    @GetMapping("/sendMsg")
    public Result sendMsg(@RequestParam(value = "msg") String msg) {
        if (StringUtils.isEmpty(msg)) return Result.error("消息不能为空");
        try {
            String rs = socketService.sendMsg(msg);
            return Result.OK(rs);
        } catch (Exception ex) {
            return Result.error(ex.getMessage());
        }
    }
}