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 map = WebSocketUsers.getUsers(); //1、监听kepserver地址 比如:OP.OP1010.START 、OP.OP1020.START 、OP.OP1030.START //2、当其中一个点位发生变化时,判断该点位是哪一个工位 // WebSocketUsers.sendMessageToUserByText(map.get(locationCode), "1"); return AjaxResult.success(); } }