石墨消解仪后端服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
607 B

3 months ago
3 months ago
3 months ago
3 months ago
  1. package com.iflytop.gd.system.service;
  2. import cn.hutool.json.JSONUtil;
  3. import com.iflytop.gd.app.common.enums.CraftStates;
  4. import com.iflytop.gd.system.config.WebSocketServer;
  5. import com.iflytop.gd.system.model.dto.WebsocketResult;
  6. import org.springframework.stereotype.Service;
  7. @Service
  8. public class WebSocketService {
  9. public void push(String type, Object data) {
  10. WebsocketResult websocketResult = new WebsocketResult();
  11. websocketResult.setType(type);
  12. websocketResult.setData(data);
  13. WebSocketServer.sendMessageToClients(JSONUtil.toJsonStr(websocketResult));
  14. }
  15. }