package cn.ezhizao.project.websocket;

import cn.ezhizao.project.monitor.domain.SysJobLog;
import cn.ezhizao.project.system.domain.SysUser;
import cn.ezhizao.project.system.mapper.SysUserMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@RequestMapping("/schedule/websocket")
public class WebSocketTestController {
    @Resource
    SysUserMapper sysUserMapper;
    @GetMapping("/push")
    public void push(SysJobLog sysJobLog) throws IOException {
        SysUser user = sysUserMapper.selectUserById(726377619918848L);
        WebSocketUser.sendInfo(user.getUserName(),"726377619918848");
    }
}
