diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/CTCLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/CTCLogicLoop.java index a036b211e..0fa34aec7 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/CTCLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/CTCLogicLoop.java @@ -1,10 +1,7 @@ package club.joylink.rtss.simulation.cbtc.CTC; import club.joylink.rtss.simulation.cbtc.CTC.data.*; -import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcStationRunPlanLogVO; -import club.joylink.rtss.simulation.cbtc.CTC.data.vo.RailDispatchCommandVO; -import club.joylink.rtss.simulation.cbtc.CTC.data.vo.RouteSequenceVO; -import club.joylink.rtss.simulation.cbtc.CTC.data.vo.TrackViewVO; +import club.joylink.rtss.simulation.cbtc.CTC.data.vo.*; import club.joylink.rtss.simulation.cbtc.CTC.service.CTCService; import club.joylink.rtss.simulation.cbtc.CTC.service.CtcDispatchCommandService; import club.joylink.rtss.simulation.cbtc.Simulation; @@ -63,11 +60,29 @@ public class CTCLogicLoop { } public void sendMessageWhenSubscribeCtc(Simulation simulation, String userId) { - sendAllTrackViewMessage(simulation, userId); - sendAllRouteSequenceMessage(simulation, userId); + sendAllBusyBoardMessage(simulation, userId); sendUnreadDispatchCommand(simulation, userId); } + private void sendAllBusyBoardMessage(Simulation simulation, String userId) { + CtcRepository ctcRepository = simulation.getCtcRepository(); + List list = new ArrayList<>(); + Map trackViewVOMap = ctcRepository.getTrackViewVOMap(); + Map routeSequenceVOMap = ctcRepository.getRouteSequenceVOMap(); + HashSet stationCodes = new HashSet<>(trackViewVOMap.keySet()); + stationCodes.addAll(routeSequenceVOMap.keySet()); + for (String stationCode : stationCodes) { + TrackViewVO trackViewVO = trackViewVOMap.get(stationCode); + RouteSequenceVO routeSequenceVO = routeSequenceVOMap.get(stationCode); + BusyBoardVO busyBoardVO = new BusyBoardVO(stationCode, routeSequenceVO, trackViewVO); + list.add(busyBoardVO); + } + + SocketMessageVO> message + = SocketMessageFactory.buildCtcBusyBoardMessage(simulation.getId(), list); + stompMessageService.sendToUser(userId, message); + } + /** * 发送该成员所属受令方的未读的调度命令 */ @@ -206,21 +221,8 @@ public class CTCLogicLoop { } } - private void sendAllTrackViewMessage(Simulation simulation, String userId) { - CtcRepository ctcRepository = simulation.getCtcRepository(); - List> list = new ArrayList<>(); - for (TrackViewVO vo : ctcRepository.getTrackViewVOMap().values()) { - Map map = new HashMap<>(); - map.put("stationCode", vo.getStationCode()); - map.put("trackView", vo); - list.add(map); - } - SocketMessageVO message = SocketMessageFactory.buildCtcBusyBoardMessage(simulation.getId(), list); - stompMessageService.sendToUser(userId, message); - } - private void sendTrackViewMessage(Simulation simulation) { - List> list = new ArrayList<>(); + List list = new ArrayList<>(); CtcRepository ctcRepository = simulation.getCtcRepository(); Map trackViewMap = ctcRepository.getTrackViewMap(); Map trackViewVOMap = ctcRepository.getTrackViewVOMap(); @@ -237,27 +239,15 @@ public class CTCLogicLoop { changedViewVO = trackViewVO.updateAndReturnChanged(trackView); } if (changedViewVO != null) { - Map map = new HashMap<>(); - map.put("stationCode", stationCode); - map.put("trackView", changedViewVO); - list.add(map); + BusyBoardVO busyBoardVO = new BusyBoardVO(stationCode, null, changedViewVO); + list.add(busyBoardVO); } } - SocketMessageVO message = SocketMessageFactory.buildCtcBusyBoardMessage(simulation.getId(), list); - stompMessageService.sendToUser(simulation.getSimulationUserIds(), message); - } - - private void sendAllRouteSequenceMessage(Simulation simulation, String userId) { - CtcRepository ctcRepository = simulation.getCtcRepository(); - List> list = new ArrayList<>(); - for (RouteSequenceVO vo : ctcRepository.getRouteSequenceVOMap().values()) { - Map map = new HashMap<>(); - map.put("stationCode", vo.getStationCode()); - map.put("routeSequence", vo); - list.add(map); + if (!CollectionUtils.isEmpty(list)) { + SocketMessageVO> message + = SocketMessageFactory.buildCtcBusyBoardMessage(simulation.getId(), list); + stompMessageService.sendToUser(simulation.getSimulationUserIds(), message); } - SocketMessageVO message = SocketMessageFactory.buildCtcBusyBoardMessage(simulation.getId(), list); - stompMessageService.sendToUser(userId, message); } /** @@ -267,30 +257,29 @@ public class CTCLogicLoop { CtcRepository ctcRepository = simulation.getCtcRepository(); Map routeSequenceMap = ctcRepository.getRouteSequenceMap(); Map routeSequenceVOMap = ctcRepository.getRouteSequenceVOMap(); - List> list = new ArrayList<>(); + List list = new ArrayList<>(); if (CollectionUtils.isEmpty(routeSequenceVOMap)) { for (RouteSequence routeSequence : routeSequenceMap.values()) { RouteSequenceVO routeSequenceVO = new RouteSequenceVO(routeSequence); routeSequenceVOMap.put(routeSequenceVO.getStationCode(), routeSequenceVO); - Map map = new HashMap<>(); - map.put("stationCode", routeSequenceVO.getStationCode()); - map.put("routeSequence", routeSequenceVO); - list.add(map); + BusyBoardVO busyBoardVO = new BusyBoardVO(routeSequenceVO.getStationCode(), routeSequenceVO, null); + list.add(busyBoardVO); } } else { for (RouteSequence routeSequence : routeSequenceMap.values()) { RouteSequenceVO vo = routeSequenceVOMap.get(routeSequence.getStationCode()); RouteSequenceVO changed = vo.updateAndReturnChanged(routeSequence); if (changed != null) { - Map map = new HashMap<>(); - map.put("stationCode", vo.getStationCode()); - map.put("routeSequence", changed); - list.add(map); + BusyBoardVO busyBoardVO = new BusyBoardVO(vo.getStationCode(), changed, null); + list.add(busyBoardVO); } } } - SocketMessageVO message = SocketMessageFactory.buildCtcBusyBoardMessage(simulation.getId(), list); - stompMessageService.sendToUser(simulation.getSimulationUserIds(), message); + if (!CollectionUtils.isEmpty(list)) { + SocketMessageVO> message + = SocketMessageFactory.buildCtcBusyBoardMessage(simulation.getId(), list); + stompMessageService.sendToUser(simulation.getSimulationUserIds(), message); + } } public void addJobs(Simulation simulation) { @@ -300,8 +289,6 @@ public class CTCLogicLoop { /** * 行车区段运行计划下发 - * - * @param simulation 仿真 */ public void sendZoneRunPlanSend(Simulation simulation) { List allList = simulation.getCtcRepository().getCtcEffectRepository().getChangeStageRunPlan(); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/BusyBoard.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/BusyBoard.java deleted file mode 100644 index 7d35efa61..000000000 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/BusyBoard.java +++ /dev/null @@ -1,5 +0,0 @@ -package club.joylink.rtss.simulation.cbtc.CTC.data; - -public class BusyBoard { - -} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java index e5f83f6ae..de3277ec1 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java @@ -158,7 +158,7 @@ public class CtcRepository { /** * 构建占线板股道视图数据 */ - private void buildTrackViewData(Simulation simulation) { + public void buildTrackViewData(Simulation simulation) { for (Station station : simulation.getRepository().getStationList()) { trackViewMap.put(station.getCode(), new TrackView(station)); } @@ -391,4 +391,14 @@ public class CtcRepository { .exception(String.format("[id:%s]的票据不存在", ticketId))); } + + public void updateTrackView(String stationCode, String oldTrackCode, String oldTripNumber, RouteSequence.Line routeSequenceLine) { + TrackView trackView = getTrackView(stationCode); + trackView.remove(oldTrackCode, oldTripNumber, routeSequenceLine); + if (routeSequenceLine.isDeparture()) { + trackView.addDepartureLine(routeSequenceLine); + } else { + trackView.addReceivingLine(routeSequenceLine); + } + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/RouteSequence.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/RouteSequence.java index 8ca1e83a1..e5cf0f2b4 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/RouteSequence.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/RouteSequence.java @@ -201,6 +201,16 @@ public class RouteSequence { private final String id; private CtcStationRunPlanLog.RunPlanItem item; + + /** + * 车次号 + */ + private String tripNumber; + + /** + * 股道 + */ + private Section track; /** * 是自触? */ @@ -229,6 +239,8 @@ public class RouteSequence { Line(String id, CtcStationRunPlanLog.RunPlanItem item, boolean departure, LocalTime startTime, LocalTime planTime, Route route) { this.id = id; this.item = item; + this.track = item == null ? null : item.getTrackSection(); + this.tripNumber = item == null ? null : item.getTripNumber(); this.departure = departure; this.startTime = startTime; this.planTime = planTime; @@ -243,14 +255,6 @@ public class RouteSequence { return departure ? "-->" + item.getStation().getName() : item.getStation().getName() + "-->"; } - public String getTripNumber() { - return this.item.getTripNumber(); - } - - public Section getTrack() { - return this.item.getTrackSection(); - } - public String getTrackName() { Section track = getTrack(); if (track == null) { @@ -277,7 +281,21 @@ public class RouteSequence { return route == null ? null : route.getCode(); } - public void updateRoute() { + public void update() { + updateTripNumber(); + updateTrack(); + updateRoute(); + } + + private void updateTripNumber() { + this.tripNumber = item == null ? null : item.getTripNumber(); + } + + private void updateTrack() { + this.track = item == null ? null : item.getTrackSection(); + } + + private void updateRoute() { boolean right = isRight(); Signal startSignal; Signal endSignal; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/TrackView.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/TrackView.java index 36ea94dac..307aea545 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/TrackView.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/TrackView.java @@ -1,5 +1,6 @@ package club.joylink.rtss.simulation.cbtc.CTC.data; +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.map.Station; @@ -75,6 +76,14 @@ public class TrackView { } } + public void remove(String trackCode, String tripNumber, RouteSequence.Line routeSequenceLine) { + Map tnLineMap = this.trackLineMap.get(trackCode); + if (tnLineMap != null) { + Line line = tnLineMap.get(tripNumber); + line.remove(routeSequenceLine); + } + } + @Getter @Setter public static class Line { @@ -274,6 +283,14 @@ public class TrackView { return "图定终到"; return departureRoute.getItem().getPlanTimeStr(); } + + public void remove(RouteSequence.Line routeSequenceLine) { + if (Objects.equals(routeSequenceLine, this.receivingRoute)) { + receivingRoute = null; + } else if (Objects.equals(routeSequenceLine, this.departureRoute)) { + departureRoute = null; + } + } } public enum Process { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/BusyBoardVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/BusyBoardVO.java new file mode 100644 index 000000000..7c194295c --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/BusyBoardVO.java @@ -0,0 +1,21 @@ +package club.joylink.rtss.simulation.cbtc.CTC.data.vo; + +import lombok.Getter; + +/** + * 占线板消息 + */ +@Getter +public class BusyBoardVO { + private String stationCode; + + private RouteSequenceVO routeSequence; + + private TrackViewVO trackView; + + public BusyBoardVO(String stationCode, RouteSequenceVO routeSequence, TrackViewVO trackView) { + this.stationCode = stationCode; + this.routeSequence = routeSequence; + this.trackView = trackView; + } +} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/RouteSequenceVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/RouteSequenceVO.java index 83fbcee82..22f526b33 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/RouteSequenceVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/RouteSequenceVO.java @@ -27,6 +27,8 @@ public class RouteSequenceVO { @JsonIgnore private final Map idLineMap; + private Set deletedLineIds; + public RouteSequenceVO() { lines = new ArrayList<>(); idLineMap = new HashMap<>(); @@ -50,17 +52,26 @@ public class RouteSequenceVO { this.idLineMap.put(line.getId(), line); } + private void removeLines(Set ids) { + for (String id : ids) { + idLineMap.remove(id); + } + lines.removeIf(lineVO -> ids.contains(lineVO.getTripNumber())); + } + public RouteSequenceVO updateAndReturnChanged(RouteSequence routeSequence) { - RouteSequenceVO routeSequenceVO = new RouteSequenceVO(); + RouteSequenceVO changedRsVO = new RouteSequenceVO(); boolean change = false; if (!Objects.equals(readOnly, routeSequence.isReadOnly())) { change = true; readOnly = routeSequence.isReadOnly(); - routeSequenceVO.setReadOnly(readOnly); + changedRsVO.setReadOnly(readOnly); } - List lines = routeSequenceVO.getLines(); + List lineVOS = changedRsVO.getLines(); + Set deletedLineIds = new HashSet<>(this.idLineMap.keySet()); + changedRsVO.setDeletedLineIds(deletedLineIds); for (RouteSequence.Line line : routeSequence.getLines()) { - // TODO: 2022/6/14 需要考虑修改股道之后,对应的进路序列删除的逻辑 + deletedLineIds.remove(line.getId()); if (line.getRoute() == null) { continue; } @@ -69,16 +80,20 @@ public class RouteSequenceVO { change = true; vo = new LineVO(line); addLine(vo); - lines.add(vo); + lineVOS.add(vo); } else { LineVO changed = vo.updateAndReturnChanged(line); if (changed != null) { change = true; - lines.add(changed); + lineVOS.add(changed); } } } - return change ? routeSequenceVO : null; + if (!deletedLineIds.isEmpty()) { + removeLines(deletedLineIds); + change = true; + } + return change ? changedRsVO : null; } @Getter diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/TrackViewVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/TrackViewVO.java index a7231a2be..d2a4779ec 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/TrackViewVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/TrackViewVO.java @@ -18,7 +18,11 @@ public class TrackViewVO { private Map> trackLineMap; - /** 被删除的数据 */ + /** + * 被删除的数据 + * k - trackCode + * v - tripNumber + */ private Map> deletedMap; public TrackViewVO(TrackView view) { @@ -59,8 +63,8 @@ public class TrackViewVO { public TrackViewVO updateAndReturnChanged(TrackView view) { boolean change = false; - TrackViewVO viewVO = new TrackViewVO(); - viewVO.setStationCode(view.getStationCode()); + TrackViewVO changedViewVO = new TrackViewVO(); + changedViewVO.setStationCode(view.getStationCode()); //股道占用 for (Section section : view.getSections()) { @@ -68,7 +72,7 @@ public class TrackViewVO { if (!Objects.equals(sectionOccupiedMap.get(section.getCode()), occupied)) { change = true; sectionOccupiedMap.put(section.getCode(), occupied); - viewVO.addSectionOccupied(section.getCode(), occupied); + changedViewVO.addSectionOccupied(section.getCode(), occupied); } } //分行数据 @@ -82,29 +86,35 @@ public class TrackViewVO { LineVO lineVO = lineVOMap.get(line.getTripNumber()); if (lineVO == null) { //没有这条记录 change = true; - viewVO.addLine(trackCode, new LineVO(line)); + LineVO vo = new LineVO(line); + addLine(trackCode, vo); + changedViewVO.addLine(trackCode, vo); } else { //有这条记录 deletedTripNumbers.remove(line.getTripNumber()); LineVO changedLineVO = lineVO.updateAndReturnChanged(line); if (changedLineVO != null) { change = true; - viewVO.addLine(trackCode, changedLineVO); + changedViewVO.addLine(trackCode, changedLineVO); } } } if (!deletedTripNumbers.isEmpty()) { change = true; - viewVO.addDeletedLine(trackCode, deletedTripNumbers); + changedViewVO.addDeletedLine(trackCode, deletedTripNumbers); + for (String deletedTripNumber : deletedTripNumbers) { + lineVOMap.remove(deletedTripNumber); + } } } if (!deletedTrackCodes.isEmpty()) { change = true; for (String trackCode : deletedTrackCodes) { - viewVO.addDeletedLine(trackCode, trackLineMap.get(trackCode).keySet()); + changedViewVO.addDeletedLine(trackCode, trackLineMap.get(trackCode).keySet()); + trackLineMap.remove(trackCode); } } - return change ? viewVO : null; + return change ? changedViewVO : null; } @Getter diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/CTCService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/CTCService.java index 6a5630f0e..e44a14e24 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/CTCService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/CTCService.java @@ -7,6 +7,7 @@ import club.joylink.rtss.simulation.cbtc.CTC.data.CtcStationRunPlanLog; import club.joylink.rtss.simulation.cbtc.CTC.data.RouteSequence; import club.joylink.rtss.simulation.cbtc.CTC.data.TrackView; import club.joylink.rtss.simulation.cbtc.Simulation; +import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder; import club.joylink.rtss.simulation.cbtc.data.map.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -29,28 +30,46 @@ public class CTCService { * 创建了新的运行计划item */ public void runPlanItemCreate(Simulation simulation, Station station, CtcStationRunPlanLog.RunPlanItem item, boolean departure) { - CtcRepository ctcRepository = simulation.getCtcRepository(); - //进路序列 - RouteSequence routeSequence = ctcRepository.getRouteSequence(station.getCode()); - AtomicInteger idGenerator = ctcRepository.getRouteSequenceIdGenerator(); - RouteSequence.Line line = RouteSequence.buildLine(item, departure, idGenerator); - routeSequence.addLine(line); - //股道视图 - TrackView trackView = ctcRepository.getTrackView(station.getCode()); - if (departure) { - trackView.addDepartureLine(line); - } else { - trackView.addReceivingLine(line); - } + regenerateRouteSequenceAndTrackView(simulation); +// CtcRepository ctcRepository = simulation.getCtcRepository(); +// //进路序列 +// RouteSequence routeSequence = ctcRepository.getRouteSequence(station.getCode()); +// AtomicInteger idGenerator = ctcRepository.getRouteSequenceIdGenerator(); +// RouteSequence.Line line = RouteSequence.buildLine(item, departure, idGenerator); +// routeSequence.addLine(line); +// //股道视图 +// TrackView trackView = ctcRepository.getTrackView(station.getCode()); +// if (departure) { +// trackView.addDepartureLine(line); +// } else { +// trackView.addReceivingLine(line); +// } } /** * 运行计划item更新了 */ public void runPlanItemUpdate(Simulation simulation, Station station, CtcStationRunPlanLog.RunPlanItem item, boolean departure) { + regenerateRouteSequenceAndTrackView(simulation); +// CtcRepository ctcRepository = simulation.getCtcRepository(); +// RouteSequence.Line routeSequenceLine = ctcRepository.getRouteSequenceLine(station.getCode(), item.getTripNumber(), departure); +// +// String oldTc = routeSequenceLine.getTrackCode(); +// String oldTn = routeSequenceLine.getTripNumber(); +// +// routeSequenceLine.update(); +// +// ctcRepository.updateTrackView(station.getCode(), oldTc, oldTn, routeSequenceLine); + } + + /** + * 重新生成进路序列和股道视图 + * 该方法应该在车务终端发送阶段计划之后调用 + */ + public void regenerateRouteSequenceAndTrackView(Simulation simulation) { + SimulationBuilder.generateRouteSequence(simulation); CtcRepository ctcRepository = simulation.getCtcRepository(); - RouteSequence.Line routeSequenceLine = ctcRepository.getRouteSequenceLine(station.getCode(), item.getTripNumber(), departure); - routeSequenceLine.updateRoute(); + ctcRepository.buildTrackViewData(simulation); } /** diff --git a/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java b/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java index a9e2dc66e..a362eefdd 100644 --- a/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java +++ b/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java @@ -3,6 +3,7 @@ package club.joylink.rtss.vo.client.factory; import club.joylink.rtss.constants.BusinessConsts.WebSocketSubscribeTopic; import club.joylink.rtss.simulation.cbtc.CTC.data.CtcStationRunPlanLog; import club.joylink.rtss.simulation.cbtc.CTC.data.Ticket; +import club.joylink.rtss.simulation.cbtc.CTC.data.vo.BusyBoardVO; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcStationRunPlanLogVO; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.RailDispatchCommandVO; import club.joylink.rtss.simulation.cbtc.Simulation; @@ -415,9 +416,9 @@ public class SocketMessageFactory { /** * CTC进路序列消息 */ - public static SocketMessageVO buildCtcBusyBoardMessage(String simulationId, - Object message) { - return build(WebSocketMessageType.Simulation_RailCtcStatus, simulationId, message); + public static SocketMessageVO> buildCtcBusyBoardMessage(String simulationId, + List body) { + return build(WebSocketMessageType.Simulation_RailCtcStatus, simulationId, body); } /** diff --git a/src/main/java/club/joylink/rtss/websocket/WebSocketMessage.java b/src/main/java/club/joylink/rtss/websocket/WebSocketMessage.java index e676752bc..4a45b23e0 100644 --- a/src/main/java/club/joylink/rtss/websocket/WebSocketMessage.java +++ b/src/main/java/club/joylink/rtss/websocket/WebSocketMessage.java @@ -15,4 +15,13 @@ public class WebSocketMessage { this.type = type; this.body = body; } + + public enum Type { + /** 所有数据 */ + ALL, + /** 更新数据 */ + UPDATE, + /** 清除数据 */ + CLEAR, + } }