admin
3 天以前 6e4a6789e948bc6a8dc9fc1aa3eebc2980be3072
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.billion.framework.websocket;
 
import com.billion.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.websocket.Session;
import javax.websocket.server.PathParam;
import java.util.Map;
 
@RestController("/socketController")
public class PostController {
 
    @GetMapping("/postWebsocket")
    public AjaxResult list(@PathParam("locationCode") String locationCode)
    {
        Map<String, Session> map = WebSocketUsers.getUsers();
        //1、监听kepserver地址 比如:OP.OP1010.START 、OP.OP1020.START 、OP.OP1030.START
        //2、当其中一个点位发生变化时,判断该点位是哪一个工位
        //
        WebSocketUsers.sendMessageToUserByText(map.get(locationCode), "1");
 
        return AjaxResult.success();
    }
 
 
}