添加食谱计划页面

This commit is contained in:
huangdeliang
2021-06-07 19:18:19 +08:00
parent 20a3168a12
commit c57defc800
8 changed files with 328 additions and 37 deletions

View File

@ -2,8 +2,8 @@ package com.stdiet.web.controller.custom;
import com.alibaba.fastjson.JSONObject;
import com.stdiet.common.core.controller.BaseController;
import com.stdiet.custom.utils.WsUtils;
import com.stdiet.custom.server.WebSocketServer;
import com.stdiet.custom.utils.WsUtils;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;
@ -38,16 +38,16 @@ public class WebSocketController extends BaseController {
}
// @Scheduled(fixedRate = 30000)
// public void boardCast() {
// try {
// JSONObject heartBeat = new JSONObject();
// heartBeat.put("type", WsUtils.WS_TYPE_HEART_BEAT);
// heartBeat.put("msg", "ping");
//
// WebSocketServer.sendInfo(heartBeat.toJSONString(), null);
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
@Scheduled(fixedRate = 1800000)
public void boardCast() {
try {
JSONObject heartBeat = new JSONObject();
heartBeat.put("type", WsUtils.WS_TYPE_SYSTEM_MESSAGE_CLEAN);
heartBeat.put("msg", "clean");
WebSocketServer.sendInfo(heartBeat.toJSONString(), null);
} catch (IOException e) {
e.printStackTrace();
}
}
}