IntelligentRecognition/ah-jjsp-service/.svn/pristine/b1/b1c0d10697370cbf86b3053b9aa...

34 lines
995 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.sercurityControl.proteam.monitor.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* @author cw chen
* @description websocket消息推送
* @date 2023-04-25 10:10
*/
@Component //1.主要用于标记配置类兼备Component的效果。
@EnableScheduling // 2.开启定时任务
public class WebSocketInfoPush {
private static final Logger log = LoggerFactory.getLogger(WebSocketInfoPush.class);
/**
* 创建websocket发送到前端通知事件
*
* @param
*/
@Async("testTaskExecutor")
// @Scheduled(cron = "0/60 * * * * ?")
public void deviceUpDownToJs() {
log.info("发送前端通知");
NoticeWebsocket.sendMessage("来自WebSocket的消息");
}
}