From 6fe2679fd8052717fbf24fdd09afedf866e35b29 Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Fri, 1 Mar 2024 18:27:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B5=9B=E9=A2=98=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E8=AE=AD=E7=BB=83=E6=8E=A5=E5=8F=A3=EF=BC=88=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtss-message | 2 +- .../joylink/rtss/bo/race/RaceContent.java | 73 + .../racetr/RaceApplicationController.java | 117 +- .../racetr/RacePaperController.java | 9 +- .../controller/racetr/RaceTaskController.java | 7 +- .../simulation/SimulationV1Controller.java | 1075 ++++----- .../services/race/RaceApplicationService.java | 118 + .../rtss/services/race/RaceTaskService.java | 33 +- .../services/training2/Training2Service.java | 4 +- .../joylink/rtss/vo/common/ModifyInfo.java | 14 +- .../joylink/rtss/vo/common/PageQuery.java | 8 +- .../joylink/rtss/vo/race/RaceApplication.java | 2048 +++++++++++++++++ .../club/joylink/rtss/vo/race/RaceModule.java | 36 +- .../club/joylink/rtss/vo/race/RacePaper.java | 48 +- .../rtss/vo/race/RaceSceneOuterClass.java | 42 +- .../rtss/vo/race/RaceSeasonOuterClass.java | 22 +- .../rtss/vo/race/RaceTaskFinishParamDTO.java | 20 + 17 files changed, 2991 insertions(+), 685 deletions(-) create mode 100644 src/main/java/club/joylink/rtss/bo/race/RaceContent.java create mode 100644 src/main/java/club/joylink/rtss/services/race/RaceApplicationService.java create mode 100644 src/main/java/club/joylink/rtss/vo/race/RaceApplication.java create mode 100644 src/main/java/club/joylink/rtss/vo/race/RaceTaskFinishParamDTO.java diff --git a/rtss-message b/rtss-message index 6b8e54c02..4ed56c665 160000 --- a/rtss-message +++ b/rtss-message @@ -1 +1 @@ -Subproject commit 6b8e54c0216e2465e84bbd6032f860647381a611 +Subproject commit 4ed56c6655935a7cbc3dd9edbb3468a96c875ffd diff --git a/src/main/java/club/joylink/rtss/bo/race/RaceContent.java b/src/main/java/club/joylink/rtss/bo/race/RaceContent.java new file mode 100644 index 000000000..fe8f4ec32 --- /dev/null +++ b/src/main/java/club/joylink/rtss/bo/race/RaceContent.java @@ -0,0 +1,73 @@ +package club.joylink.rtss.bo.race; + +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.vo.race.RaceApplication; +import club.joylink.rtss.vo.race.RaceApplication.ResultNode; +import club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder; +import club.joylink.rtss.vo.race.RaceTask; +import club.joylink.rtss.vo.race.RaceTask.RacePaperSingleModuleGroupTask; +import club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO; +import club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Data; + +@Data +public class RaceContent { + + private long userId; + private long paperId; + private int moduleId; + + /** + * 训练使用到的任务树 + */ + private RaceTask.RacePaperSingleModuleGroupTask taskTree; + + /** + * 训练结果 + */ + private RaceApplication.RacePracticeResult.Builder result; + + /** + * 结果节点映射。仅为了通过ID找节点 + */ + private Map resultNodeMap = new HashMap<>(); + + public RaceContent(long userId, long paperId, int moduleId, + RacePaperSingleModuleGroupTask taskTree) { + this.userId = userId; + this.paperId = paperId; + this.moduleId = moduleId; + this.taskTree = taskTree; + this.result = RaceApplication.RacePracticeResult.newBuilder(); + result.setCustomModuleId(taskTree.getCustomModuleId()); + List nodeBuilderList = result.getNodeBuilderList(); + buildResultNodeTree(taskTree.getChildList(), nodeBuilderList); + } + + public Builder getResultNode(long taskId) { + Builder builder = resultNodeMap.get(taskId); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(builder, + String.format("任务[%d]不存在", taskId)); + return builder; + } + + private void buildResultNodeTree(List childrenList, + List nodeBuilderList) { + for (RaceTaskChildVO childVO : childrenList) { + //构建对应的结果Node + Builder nodeBuilder = ResultNode.newBuilder(); + nodeBuilder.setName(childVO.getName()); + nodeBuilder.setType(childVO.getNodeType()); + nodeBuilderList.add(nodeBuilder); + //构建任务映射 + if (ChildNodeType.TASK == childVO.getNodeType()) { + resultNodeMap.put(childVO.getId(), nodeBuilder); + } + //递归 + buildResultNodeTree(childVO.getChildrenList(), nodeBuilder.getChildBuilderList()); + } + } +} diff --git a/src/main/java/club/joylink/rtss/controller/racetr/RaceApplicationController.java b/src/main/java/club/joylink/rtss/controller/racetr/RaceApplicationController.java index 52927a2a3..3ae153a82 100644 --- a/src/main/java/club/joylink/rtss/controller/racetr/RaceApplicationController.java +++ b/src/main/java/club/joylink/rtss/controller/racetr/RaceApplicationController.java @@ -1,6 +1,18 @@ package club.joylink.rtss.controller.racetr; -import org.springframework.web.bind.annotation.*; +import club.joylink.rtss.services.race.RaceApplicationService; +import club.joylink.rtss.vo.AccountVO; +import club.joylink.rtss.vo.LoginUserInfoVO; +import club.joylink.rtss.vo.race.RaceApplication; +import club.joylink.rtss.vo.race.RaceTaskFinishParamDTO; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 赛题训练接口 @@ -8,59 +20,66 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/api/race") public class RaceApplicationController { - /** - * 开始训练 - * - * @param paperId 赛题ID - * @return 训练的信息 - */ - @PostMapping("/{paperId}") - public Object start(@PathVariable long paperId) { - //暂时就用用户id作为竞赛上下文的id,也就是说一个用户同时只能开一个竞赛 - return null; - } - /** - * 加载场景 - * - * @param simulationId 场景依托的仿真 - * @param sceneId 场景的ID - */ - @PutMapping("/{simulationId}/{sceneId}/load") - public void loadScene(@PathVariable String simulationId, @PathVariable String sceneId) { + private RaceApplicationService raceApplicationService; - } + /** + * 开始训练 + *

+ * 目前用用户id作为训练上下文的ID,即用户同时进行一个训练 + * + * @param paperId 赛题ID + * @return 训练的信息 + */ + @PostMapping("/{paperId}/{moduleId}") + public Object start(@PathVariable long paperId, @PathVariable int moduleId, + @RequestAttribute AccountVO user) { + return raceApplicationService.start(paperId, moduleId, user.getId()); + } - /** - * 完成任务 - * - * @param taskId 任务ID - * @param record 任务记录(需要前端进行判定的操作的记录) - */ - @PutMapping("/{taskId}/finish") - public void finishTask(@PathVariable long taskId, @RequestBody Object record) { + /** + * 加载场景 + * + * @param simulationId 场景依托的仿真 + * @param sceneId 场景的ID + */ + @PutMapping("/{simulationId}/load/{sceneId}") + public void loadScene(@PathVariable String simulationId, @PathVariable long sceneId, + @RequestAttribute LoginUserInfoVO loginInfo) { + raceApplicationService.loadScene(simulationId, sceneId, loginInfo); + } - } + /** + * 完成任务 + * + * @param taskId 任务ID + * @param paramDTO 完成任务所需的参数。主要就是需要前端做判定的操作/步骤 + */ + @PutMapping("/{taskId}/finish") + public void finishTask(@PathVariable long taskId, @RequestBody RaceTaskFinishParamDTO paramDTO, + @RequestAttribute AccountVO user) { + raceApplicationService.finishTask(taskId, paramDTO, user); + } - /** - * 完成训练 - * - * @return 评分结果 - */ - public Object finish() { - return null; - } + /** + * 完成训练 + * + * @return 评分结果 + */ + public RaceApplication.RacePracticeResult finish(@RequestAttribute AccountVO user) { + return raceApplicationService.finish(user.getId()); + } - /** - * 获取用户正在进行的竞赛信息 - *

- * 目前想到的使用场景就是页面刷新后 - * - * @return 竞赛信息 - */ - @GetMapping("") - public Object getRaceInfo() { - return null; - } + /** + * 获取用户正在进行的竞赛信息 + *

+ * 目前想到的使用场景就是页面刷新后 + * + * @return 竞赛信息 + */ + @GetMapping("") + public Object getRaceInfo() { + return null; + } } diff --git a/src/main/java/club/joylink/rtss/controller/racetr/RacePaperController.java b/src/main/java/club/joylink/rtss/controller/racetr/RacePaperController.java index e01364f79..e22a2d354 100644 --- a/src/main/java/club/joylink/rtss/controller/racetr/RacePaperController.java +++ b/src/main/java/club/joylink/rtss/controller/racetr/RacePaperController.java @@ -48,7 +48,8 @@ public class RacePaperController { * @param user */ @PostMapping("/{id}") - public void update(@PathVariable("id") Long id, @RequestBody RacePaperCreateVO updateVO, @RequestAttribute AccountVO user) { + public void update(@PathVariable("id") Long id, @RequestBody RacePaperCreateVO updateVO, + @RequestAttribute AccountVO user) { this.racePaperService.update(id, updateVO, user); } @@ -68,7 +69,8 @@ public class RacePaperController { * @param user */ @PostMapping("/{id}/config") - public void configSeting(@PathVariable("id") Long id, @RequestBody RacePaperModuleVO moduleVO, @RequestAttribute AccountVO user) { + public void configSeting(@PathVariable("id") Long id, @RequestBody RacePaperModuleVO moduleVO, + @RequestAttribute AccountVO user) { this.racePaperService.configSeting(id, moduleVO, user); } @@ -112,7 +114,8 @@ public class RacePaperController { */ @GetMapping("/{paperId}/module/{moduleId}/task") - public RacePaperSingleModuleGroupTask paperModuleTask(@PathVariable("paperId") Long id, @PathVariable("moduleId") Integer moduleId) { + public RacePaperSingleModuleGroupTask paperModuleTask(@PathVariable("paperId") Long id, + @PathVariable("moduleId") Integer moduleId) { return this.racePaperService.singlePaperModuleTask(id, moduleId); } diff --git a/src/main/java/club/joylink/rtss/controller/racetr/RaceTaskController.java b/src/main/java/club/joylink/rtss/controller/racetr/RaceTaskController.java index 6ab00dfba..61529f561 100644 --- a/src/main/java/club/joylink/rtss/controller/racetr/RaceTaskController.java +++ b/src/main/java/club/joylink/rtss/controller/racetr/RaceTaskController.java @@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -37,12 +36,14 @@ public class RaceTaskController { } @PostMapping("/{id}") - public void update(@PathVariable("id") Long id, @RequestBody RaceTaskCreateVO vo, @RequestAttribute AccountVO user) { + public void update(@PathVariable("id") Long id, @RequestBody RaceTaskCreateVO vo, + @RequestAttribute AccountVO user) { this.taskService.update(id, vo, user); } @PostMapping("/{taskId}/bind") - public void bind(@PathVariable("taskId") Long taskId, @RequestBody List bind, @RequestAttribute AccountVO user) { + public void bind(@PathVariable("taskId") Long taskId, @RequestBody List bind, + @RequestAttribute AccountVO user) { this.taskService.bind(taskId, bind, user); } diff --git a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java index 9b379d8b0..a18b81ac4 100644 --- a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java +++ b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java @@ -32,22 +32,37 @@ import club.joylink.rtss.vo.client.operation.DriveParamVO; import club.joylink.rtss.vo.client.psl.PslStatus; import club.joylink.rtss.vo.client.runplan.PlanTripNumberVO; import club.joylink.rtss.vo.client.runplan.RunPlanEChartsDataVO; -import club.joylink.rtss.vo.client.simulationv1.*; +import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam; +import club.joylink.rtss.vo.client.simulationv1.SimulationInfoQueryVO; +import club.joylink.rtss.vo.client.simulationv1.SimulationLogPagedQueryVO; +import club.joylink.rtss.vo.client.simulationv1.SimulationMemberVO; +import club.joylink.rtss.vo.client.simulationv1.SimulationUserVO; import club.joylink.rtss.vo.map.MapVO; import club.joylink.rtss.vo.map.graph.MapStationNewVO; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.util.StringUtils; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 新仿真接口 @@ -56,319 +71,319 @@ import java.util.stream.Stream; @RequestMapping("/simulation") public class SimulationV1Controller { - @Autowired - private GroupSimulationService groupSimulationService; + @Autowired + private GroupSimulationService groupSimulationService; - @Autowired - private IVirtualRealityIbpService iVirtualRealityIBPService; + @Autowired + private IVirtualRealityIbpService iVirtualRealityIBPService; - @Autowired - private SimulationSupportService simulationSupportService; + @Autowired + private SimulationSupportService simulationSupportService; - @Autowired - private IVirtualRealityPslService iVirtualRealityPslService; - @Autowired - private SimulationService simulationService; - @Autowired - private SimulationManager simulationManager; - @Autowired - private MemberManager memberManager; + @Autowired + private IVirtualRealityPslService iVirtualRealityPslService; + @Autowired + private SimulationService simulationService; + @Autowired + private SimulationManager simulationManager; + @Autowired + private MemberManager memberManager; - /** - * 根据产品类型创建仿真 - */ - @GetMapping("") - public String simulation(Long mapId, String prdType, - @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) - LoginUserInfoVO loginUserInfoVO) { - String simulation = this.groupSimulationService.simulation(mapId, prdType, loginUserInfoVO); - return simulation; + /** + * 根据产品类型创建仿真 + */ + @GetMapping("") + public String simulation(Long mapId, String prdType, + @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) + LoginUserInfoVO loginUserInfoVO) { + String simulation = this.groupSimulationService.simulation(mapId, prdType, loginUserInfoVO); + return simulation; + } + + /** + * 创建实训仿真 + */ + @GetMapping(path = "/training/{trainingId}") + public String trainingSimulation(@PathVariable Long trainingId, + @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) + LoginUserInfoVO loginUserInfoVO) { + return this.groupSimulationService.trainingSimulation(trainingId, loginUserInfoVO); + } + + /** + * 创建考试仿真 + */ + @GetMapping(path = "/exam/{examId}") + public String examSimulate(@PathVariable Long examId, + @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) + LoginUserInfoVO loginUserInfoVO) { + return this.groupSimulationService.examSimulation(examId, loginUserInfoVO); + } + + /** + * 获取客户端已经进入仿真的用户仿真所在group + */ + @GetMapping(path = "/running") + public List getRunningSimulationBySubscribeUser(@RequestAttribute AccountVO user) { + return this.groupSimulationService.getUserRunningSimulationGroups(user); + } + + /** + * 根据仿真group获取仿真基础信息 + */ + @GetMapping("/{group}") + public SimulationVO getSimulationBasicInfo(@PathVariable String group) { + return this.groupSimulationService.getSimulationBasicInfo(group); + } + + /** + * 获取用户在仿真中的用户信息 + */ + @GetMapping("/{group}/simulationUser") + public SimulationUserVO getSimulationUserInfo(@PathVariable String group, + @RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY) + AccountVO accountVO) { + return this.groupSimulationService.getSimulationUserInfo(group, accountVO); + } + + /** + * 获取所有仿真用户 + */ + @GetMapping("/{group}/simulationUsers") + public List queryAllSimulationUsers(@PathVariable String group) { + return this.groupSimulationService.queryAllSimulationUsers(group); + } + + /** + * 根据仿真group获取仿真地图数据 + */ + @GetMapping("/{group}/mapData") + public MapVO getSimulationMapData(@PathVariable String group) { + return this.groupSimulationService.getSimulationMapData(group); + } + + /** + * 根据group获取排序的车站列表(包含车辆段/停车场) + */ + @GetMapping("/{group}/stationWithDepot") + public List getSortedStationListWithDepot(@PathVariable String group) { + return this.groupSimulationService.getSortedStationListWithDepot(group); + } + + /** + * 加载指定运行计划到仿真中 + */ + @PutMapping("/{group}/load/runPlan/{templateId}") + public void loadRunPlan(@PathVariable String group, @PathVariable Long templateId) { + this.groupSimulationService.loadRunPlan(group, templateId); + } + + /** + * 加载草稿运行图 + */ + @PutMapping("/{simulationId}/load/draftRunPlan/{draftRunPlanId}") + public void loadDraftRunPlan(@PathVariable String simulationId, + @PathVariable long draftRunPlanId) { + this.simulationService.loadDraftRunPlan(simulationId, draftRunPlanId); + } + + /** + * 根据仿真group获取仿真运行图 + */ + @GetMapping("/{group}/runPlan") + public RunPlanEChartsDataVO getSimulationRunPlan(@PathVariable String group) { + return this.groupSimulationService.getSimulationRunPlan(group); + } + + /** + * 获取仿真运行图车次号列表 + */ + @GetMapping("/{group}/tripNumbers") + public List getSimulationRunPlanTripNumbers(@PathVariable String group) { + return this.groupSimulationService.getSimulationRunPlanTripNumbers(group); + } + + /** + * 根据车次号获取服务号 + */ + @GetMapping("/{group}/serviceNumber") + public List getServiceNumberByTripNumber(@PathVariable String group, String tripNumber) { + return this.groupSimulationService.getServiceNumberByTripNumber(group, tripNumber); + } + + /** + * 根据车次号获取计划车次信息 + */ + @GetMapping("/{group}/planTripInfo") + public PlanTripNumberVO getPlanTripByTripNumber(@PathVariable String group, String tripNumber) { + return this.groupSimulationService.getPlanTripByTripNumber(group, tripNumber); + } + + /** + * 根据服务号和车次号获取计划车次信息 + */ + @GetMapping("/{group}/planTripInfoBySt") + public PlanTripNumberVO planTripInfoBySt(@PathVariable String group, String serviceNumber, + String tripNumber) { + return this.groupSimulationService.planTripInfoByServiceAndTripNumber(group, serviceNumber, + tripNumber); + } + + /** + * 仿真操作 + */ + @PostMapping("/{group}/operate/{type}") + public Object operate(@PathVariable @NotBlank String group, @PathVariable @NotNull String type, + @RequestBody(required = false) Map param, @RequestAttribute AccountVO user) { + if (null == param) { + param = new HashMap<>(); } + return this.groupSimulationService.operate(group, type, param, user); + } - /** - * 创建实训仿真 - */ - @GetMapping(path = "/training/{trainingId}") - public String trainingSimulation(@PathVariable Long trainingId, - @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) - LoginUserInfoVO loginUserInfoVO) { - return this.groupSimulationService.trainingSimulation(trainingId, loginUserInfoVO); - } + /** + * 仿真指令 + */ + @PostMapping("/{group}/command") + public void command(@PathVariable String group, + @RequestBody @Validated CommandInitiateVO initiateVO, @RequestAttribute AccountVO user) { + Simulation simulation = this.groupSimulationService.getSimulationByGroup(group); + SimulationMember member = simulation.getSimulationMemberByUserId(user.getId()); + this.groupSimulationService.command(simulation, initiateVO, member); + } - /** - * 创建考试仿真 - */ - @GetMapping(path = "/exam/{examId}") - public String examSimulate(@PathVariable Long examId, - @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) - LoginUserInfoVO loginUserInfoVO) { - return this.groupSimulationService.examSimulation(examId, loginUserInfoVO); - } + /** + * 根据计划时间获取此时间点可以加载的最大列车数量 + */ + @GetMapping("/{group}/loadTrainNumber") + public int getLoadTrainNumber(@PathVariable String group, + @DateTimeFormat(pattern = "HH:mm:ss") LocalTime time) { + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(time, "时间不能为空"); + return this.groupSimulationService.getGivenTimeCouldLoadedTrainNumber(group, time); + } - /** - * 获取客户端已经进入仿真的用户仿真所在group - */ - @GetMapping(path = "/running") - public List getRunningSimulationBySubscribeUser(@RequestAttribute AccountVO user) { - return this.groupSimulationService.getUserRunningSimulationGroups(user); - } + /** + * 按计划行车 + */ + @PostMapping("/{group}/ranAsPlan") + public void runAsPlan(@PathVariable String group, @RequestBody @Validated RunAsPlanParam param) { + this.groupSimulationService.runAsPlan(group, param); + } - /** - * 根据仿真group获取仿真基础信息 - */ - @GetMapping("/{group}") - public SimulationVO getSimulationBasicInfo(@PathVariable String group) { - return this.groupSimulationService.getSimulationBasicInfo(group); - } + /** + * 修改仿真系统时间 + */ + @PutMapping("/{group}/modifySystemTime") + public void modifySystemTime(@PathVariable String group, @RequestBody RunAsPlanParam param) { + this.groupSimulationService.modifySystemTime(group, param.getTime()); + } - /** - * 获取用户在仿真中的用户信息 - */ - @GetMapping("/{group}/simulationUser") - public SimulationUserVO getSimulationUserInfo(@PathVariable String group, - @RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY) - AccountVO accountVO) { - return this.groupSimulationService.getSimulationUserInfo(group, accountVO); - } + /** + * 退出计划 + */ + @PostMapping("/{group}/planOver") + public void planOver(@PathVariable String group) { + this.groupSimulationService.planOver(group); + } - /** - * 获取所有仿真用户 - */ - @GetMapping("/{group}/simulationUsers") - public List queryAllSimulationUsers(@PathVariable String group) { - return this.groupSimulationService.queryAllSimulationUsers(group); - } + /** + * 退出仿真(主要是非房主用户退出综合演练用) + */ + @PutMapping("/{simulationId}/exit") + public void exitSimulation(@PathVariable String simulationId, @RequestAttribute AccountVO user) { + this.groupSimulationService.exitSimulation(simulationId, user); + } - /** - * 根据仿真group获取仿真地图数据 - */ - @GetMapping("/{group}/mapData") - public MapVO getSimulationMapData(@PathVariable String group) { - return this.groupSimulationService.getSimulationMapData(group); - } + /** + * 销毁仿真。 由系统管理员或老师在仿真监管功能中使用 + */ + @DeleteMapping("/{simulationId}/destroy") + public void destroySimulation(@PathVariable String simulationId) { + this.groupSimulationService.clearSimulation(simulationId); + } - /** - * 根据group获取排序的车站列表(包含车辆段/停车场) - */ - @GetMapping("/{group}/stationWithDepot") - public List getSortedStationListWithDepot(@PathVariable String group) { - return this.groupSimulationService.getSortedStationListWithDepot(group); - } + /** + * 加载剧本并扮演成员(已发布的剧本) + */ + @PutMapping(path = "/{group}/script/{scriptId}") + public void loadScriptAndPlayMember(@PathVariable String group, + @PathVariable Long scriptId, + String memberId, + ScriptBO.Mode mode, + @RequestAttribute AccountVO user) { + this.groupSimulationService.loadScriptAndPlayMember(group, scriptId, memberId, mode, user); + } - /** - * 加载指定运行计划到仿真中 - */ - @PutMapping("/{group}/load/runPlan/{templateId}") - public void loadRunPlan(@PathVariable String group, @PathVariable Long templateId) { - this.groupSimulationService.loadRunPlan(group, templateId); - } + /** + * 退出剧本 + */ + @PutMapping(path = "/{group}/exitScript") + public void exitScript(@PathVariable @NotBlank String group, @RequestAttribute AccountVO user) { + this.groupSimulationService.exitScript(group, user); + } - /** - * 加载草稿运行图 - */ - @PutMapping("/{simulationId}/load/draftRunPlan/{draftRunPlanId}") - public void loadDraftRunPlan(@PathVariable String simulationId, - @PathVariable long draftRunPlanId) { - this.simulationService.loadDraftRunPlan(simulationId, draftRunPlanId); - } + /** + * 获取所有仿真成员列表 + */ + @GetMapping(path = "/{group}/members") + public List getSimulationMembers(@PathVariable @NotBlank String group) { + return this.groupSimulationService.getSimulationMembers(group); + } - /** - * 根据仿真group获取仿真运行图 - */ - @GetMapping("/{group}/runPlan") - public RunPlanEChartsDataVO getSimulationRunPlan(@PathVariable String group) { - return this.groupSimulationService.getSimulationRunPlan(group); - } + /** + * 获取仿真设备故障列表 + */ + @GetMapping(path = "/{group}/deviceFaultInfos") + public List getSimulationDeviceFaultInfoList( + @PathVariable @NotBlank String group) { + return this.groupSimulationService.getSimulationDeviceFaultInfoList(group); + } - /** - * 获取仿真运行图车次号列表 - */ - @GetMapping("/{group}/tripNumbers") - public List getSimulationRunPlanTripNumbers(@PathVariable String group) { - return this.groupSimulationService.getSimulationRunPlanTripNumbers(group); + /** + * 取消自动故障 + */ + @PutMapping(path = "/{group}/faultMode/{id}") + public void setFaultMode(@PathVariable @NotBlank String group, + @PathVariable(required = false) Integer id) { + if (Objects.isNull(id)) { + this.groupSimulationService.clearAllAutoFault(group); + return; } + this.groupSimulationService.cancelAutoFault(group, id); + } - /** - * 根据车次号获取服务号 - */ - @GetMapping("/{group}/serviceNumber") - public List getServiceNumberByTripNumber(@PathVariable String group, String tripNumber) { - return this.groupSimulationService.getServiceNumberByTripNumber(group, tripNumber); - } + /** + * 设置自动故障 + */ + @PostMapping(path = "/{group}/faultMode") + public Integer setFaultMode(@PathVariable @NotBlank String group, + @RequestBody FaultRuleVO ruleVO) { + return this.groupSimulationService.setFaultMode(group, ruleVO); + } - /** - * 根据车次号获取计划车次信息 - */ - @GetMapping("/{group}/planTripInfo") - public PlanTripNumberVO getPlanTripByTripNumber(@PathVariable String group, String tripNumber) { - return this.groupSimulationService.getPlanTripByTripNumber(group, tripNumber); - } + /** + * 查询已设置所有的自动触发故障 + */ + @GetMapping(path = "/{group}/faultMode/faultRule") + public Set getNotTriggerAutoFault(@PathVariable @NotBlank String group) { + return this.groupSimulationService.getTriggerAutoFaults(group); + } - /** - * 根据服务号和车次号获取计划车次信息 - */ - @GetMapping("/{group}/planTripInfoBySt") - public PlanTripNumberVO planTripInfoBySt(@PathVariable String group, String serviceNumber, - String tripNumber) { - return this.groupSimulationService.planTripInfoByServiceAndTripNumber(group, serviceNumber, - tripNumber); - } + /** + * 查询所有目的地码 + */ + @GetMapping("/{group}/destinationCode/list") + public List getAllDestinationCode(@PathVariable String group) { + return this.groupSimulationService.getAllDestinationCode(group); + } - /** - * 仿真操作 - */ - @PostMapping("/{group}/operate/{type}") - public Object operate(@PathVariable @NotBlank String group, @PathVariable @NotNull String type, - @RequestBody(required = false) Map param, @RequestAttribute AccountVO user) { - if (null == param) { - param = new HashMap<>(); - } - return this.groupSimulationService.operate(group, type, param, user); - } - - /** - * 仿真指令 - */ - @PostMapping("/{group}/command") - public void command(@PathVariable String group, - @RequestBody @Validated CommandInitiateVO initiateVO, @RequestAttribute AccountVO user) { - Simulation simulation = this.groupSimulationService.getSimulationByGroup(group); - SimulationMember member = simulation.getSimulationMemberByUserId(user.getId()); - this.groupSimulationService.command(simulation, initiateVO, member); - } - - /** - * 根据计划时间获取此时间点可以加载的最大列车数量 - */ - @GetMapping("/{group}/loadTrainNumber") - public int getLoadTrainNumber(@PathVariable String group, - @DateTimeFormat(pattern = "HH:mm:ss") LocalTime time) { - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(time, "时间不能为空"); - return this.groupSimulationService.getGivenTimeCouldLoadedTrainNumber(group, time); - } - - /** - * 按计划行车 - */ - @PostMapping("/{group}/ranAsPlan") - public void runAsPlan(@PathVariable String group, @RequestBody @Validated RunAsPlanParam param) { - this.groupSimulationService.runAsPlan(group, param); - } - - /** - * 修改仿真系统时间 - */ - @PutMapping("/{group}/modifySystemTime") - public void modifySystemTime(@PathVariable String group, @RequestBody RunAsPlanParam param) { - this.groupSimulationService.modifySystemTime(group, param.getTime()); - } - - /** - * 退出计划 - */ - @PostMapping("/{group}/planOver") - public void planOver(@PathVariable String group) { - this.groupSimulationService.planOver(group); - } - - /** - * 退出仿真(主要是非房主用户退出综合演练用) - */ - @PutMapping("/{simulationId}/exit") - public void exitSimulation(@PathVariable String simulationId, @RequestAttribute AccountVO user) { - this.groupSimulationService.exitSimulation(simulationId, user); - } - - /** - * 销毁仿真。 由系统管理员或老师在仿真监管功能中使用 - */ - @DeleteMapping("/{simulationId}/destroy") - public void destroySimulation(@PathVariable String simulationId) { - this.groupSimulationService.clearSimulation(simulationId); - } - - /** - * 加载剧本并扮演成员(已发布的剧本) - */ - @PutMapping(path = "/{group}/script/{scriptId}") - public void loadScriptAndPlayMember(@PathVariable String group, - @PathVariable Long scriptId, - String memberId, - ScriptBO.Mode mode, - @RequestAttribute AccountVO user) { - this.groupSimulationService.loadScriptAndPlayMember(group, scriptId, memberId, mode, user); - } - - /** - * 退出剧本 - */ - @PutMapping(path = "/{group}/exitScript") - public void exitScript(@PathVariable @NotBlank String group, @RequestAttribute AccountVO user) { - this.groupSimulationService.exitScript(group, user); - } - - /** - * 获取所有仿真成员列表 - */ - @GetMapping(path = "/{group}/members") - public List getSimulationMembers(@PathVariable @NotBlank String group) { - return this.groupSimulationService.getSimulationMembers(group); - } - - /** - * 获取仿真设备故障列表 - */ - @GetMapping(path = "/{group}/deviceFaultInfos") - public List getSimulationDeviceFaultInfoList( - @PathVariable @NotBlank String group) { - return this.groupSimulationService.getSimulationDeviceFaultInfoList(group); - } - - /** - * 取消自动故障 - */ - @PutMapping(path = "/{group}/faultMode/{id}") - public void setFaultMode(@PathVariable @NotBlank String group, - @PathVariable(required = false) Integer id) { - if (Objects.isNull(id)) { - this.groupSimulationService.clearAllAutoFault(group); - return; - } - this.groupSimulationService.cancelAutoFault(group, id); - } - - /** - * 设置自动故障 - */ - @PostMapping(path = "/{group}/faultMode") - public Integer setFaultMode(@PathVariable @NotBlank String group, - @RequestBody FaultRuleVO ruleVO) { - return this.groupSimulationService.setFaultMode(group, ruleVO); - } - - /** - * 查询已设置所有的自动触发故障 - */ - @GetMapping(path = "/{group}/faultMode/faultRule") - public Set getNotTriggerAutoFault(@PathVariable @NotBlank String group) { - return this.groupSimulationService.getTriggerAutoFaults(group); - } - - /** - * 查询所有目的地码 - */ - @GetMapping("/{group}/destinationCode/list") - public List getAllDestinationCode(@PathVariable String group) { - return this.groupSimulationService.getAllDestinationCode(group); - } - - /** - * 获取IBP盘状态 - */ - @GetMapping("/{group}/{stationCode}/ibp/status") - public IbpStatus getIbpStatus(@PathVariable String group, @PathVariable String stationCode) { - return iVirtualRealityIBPService.getIbpStatus(group, stationCode); - } + /** + * 获取IBP盘状态 + */ + @GetMapping("/{group}/{stationCode}/ibp/status") + public IbpStatus getIbpStatus(@PathVariable String group, @PathVariable String stationCode) { + return iVirtualRealityIBPService.getIbpStatus(group, stationCode); + } // /** // * 按下IBP盘按钮 @@ -386,90 +401,90 @@ public class SimulationV1Controller { // iVirtualRealityIBPService.releaseTheElement(group, stationCode, buttonCode); // } - /** - * 查询报警列表 - */ - @GetMapping(path = "/{group}/alarm") - public List listAlarm(@PathVariable String group, String level, - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime startTime, - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) { - return groupSimulationService.listAlarm(group, level, startTime, endTime); - } + /** + * 查询报警列表 + */ + @GetMapping(path = "/{group}/alarm") + public List listAlarm(@PathVariable String group, String level, + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime startTime, + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) { + return groupSimulationService.listAlarm(group, level, startTime, endTime); + } - /** - * 仿真报警确认 - */ - @PutMapping(path = "/{group}/alarm/confirm") - public void AlarmConfirm(@PathVariable String group, @RequestBody List codes, - @RequestAttribute AccountVO user) { - groupSimulationService.alarmConfirm(group, codes, user); - } + /** + * 仿真报警确认 + */ + @PutMapping(path = "/{group}/alarm/confirm") + public void AlarmConfirm(@PathVariable String group, @RequestBody List codes, + @RequestAttribute AccountVO user) { + groupSimulationService.alarmConfirm(group, codes, user); + } - /** - * 仿真客流数据切换 - */ - @PutMapping(path = "/{group}/passengerFlow/{passengerFlowId}") - public void AlarmConfirm(@PathVariable String group, @PathVariable Long passengerFlowId) { - groupSimulationService.changePassengerFlow(group, passengerFlowId); - } + /** + * 仿真客流数据切换 + */ + @PutMapping(path = "/{group}/passengerFlow/{passengerFlowId}") + public void AlarmConfirm(@PathVariable String group, @PathVariable Long passengerFlowId) { + groupSimulationService.changePassengerFlow(group, passengerFlowId); + } - /** - * 获取仿真日志 - */ - @GetMapping("/{group}/log") - public PageVO getLog(@PathVariable String group, - SimulationLogPagedQueryVO queryVO) { - return groupSimulationService.getLog(group, queryVO); - } + /** + * 获取仿真日志 + */ + @GetMapping("/{group}/log") + public PageVO getLog(@PathVariable String group, + SimulationLogPagedQueryVO queryVO) { + return groupSimulationService.getLog(group, queryVO); + } - /** - * 获取机器人驾驶参数 - */ - @GetMapping("/{simulationId}/driveParam/{groupNumber}") - public DriveParamVO getDriveParam(@PathVariable String simulationId, - @PathVariable String groupNumber) { - return groupSimulationService.getDriveParam(simulationId, groupNumber); - } + /** + * 获取机器人驾驶参数 + */ + @GetMapping("/{simulationId}/driveParam/{groupNumber}") + public DriveParamVO getDriveParam(@PathVariable String simulationId, + @PathVariable String groupNumber) { + return groupSimulationService.getDriveParam(simulationId, groupNumber); + } - /* ----------------------- 泰雷兹操作辅助接口 ----------------------- */ + /* ----------------------- 泰雷兹操作辅助接口 ----------------------- */ - /** - * 查询进路路径 - */ - @GetMapping("/{group}/querySectionPaths") - public List> querySectionPaths(@PathVariable String group, String groupNumber, - String standCode, String signalCode) { - return simulationSupportService.queryRoutePaths(group, groupNumber, standCode, signalCode); - } + /** + * 查询进路路径 + */ + @GetMapping("/{group}/querySectionPaths") + public List> querySectionPaths(@PathVariable String group, String groupNumber, + String standCode, String signalCode) { + return simulationSupportService.queryRoutePaths(group, groupNumber, standCode, signalCode); + } - /** - * 查询列车或运行线经过的站台 - */ - @GetMapping("/{group}/queryStands/trainOrDestination") - public List queryStandsThatTrainGoingThrough(@PathVariable String group, - String groupNumber, String destinationCode) { - return simulationSupportService.queryStandsThatTrainGoingThrough(group, groupNumber, - destinationCode); - } + /** + * 查询列车或运行线经过的站台 + */ + @GetMapping("/{group}/queryStands/trainOrDestination") + public List queryStandsThatTrainGoingThrough(@PathVariable String group, + String groupNumber, String destinationCode) { + return simulationSupportService.queryStandsThatTrainGoingThrough(group, groupNumber, + destinationCode); + } - /** - * 查询为该列车已建立的进路 - */ - @GetMapping("/{group}/queryEstablishedRoutes/{groupNumber}") - public List queryEstablishedRoutes(@PathVariable String group, - @PathVariable String groupNumber) { - return simulationSupportService.queryEstablishedRoutes(group, groupNumber); - } + /** + * 查询为该列车已建立的进路 + */ + @GetMapping("/{group}/queryEstablishedRoutes/{groupNumber}") + public List queryEstablishedRoutes(@PathVariable String group, + @PathVariable String groupNumber) { + return simulationSupportService.queryEstablishedRoutes(group, groupNumber); + } - /* ----------------------- PSL盘接口 ----------------------- */ + /* ----------------------- PSL盘接口 ----------------------- */ - /** - * 获取PSL盘状态 - */ - @GetMapping("/{group}/{standCode}/psl/status") - public PslStatus getPslStatus(@PathVariable String group, @PathVariable String standCode) { - return iVirtualRealityPslService.getStatus(group, standCode); - } + /** + * 获取PSL盘状态 + */ + @GetMapping("/{group}/{standCode}/psl/status") + public PslStatus getPslStatus(@PathVariable String group, @PathVariable String standCode) { + return iVirtualRealityPslService.getStatus(group, standCode); + } // /** // * 按下PSL盘按钮 @@ -479,169 +494,169 @@ public class SimulationV1Controller { // iVirtualRealityPslService.pressTheButton(group, standCode, button); // } - /* ----------------------- ISCS接口 ----------------------- */ + /* ----------------------- ISCS接口 ----------------------- */ - /** - * 条件查询仿真中的ISCS系统资源 - */ - @GetMapping("/{group}/iscs/systemResources") - public List getAllIscsSystemResources(@PathVariable String group, - IscsSystemResourcesQueryVO queryVO) { - return groupSimulationService.getAllIscsSystemResources(group, queryVO); + /** + * 条件查询仿真中的ISCS系统资源 + */ + @GetMapping("/{group}/iscs/systemResources") + public List getAllIscsSystemResources(@PathVariable String group, + IscsSystemResourcesQueryVO queryVO) { + return groupSimulationService.getAllIscsSystemResources(group, queryVO); + } + + /** + * 查询所有pa系统的定时播放任务 + */ + @GetMapping("/{group}/iscs/paTimedPlay") + public List getPaTimedPlay(@PathVariable String group, String stationCode) { + return groupSimulationService.getAllPaTimedPlayInfo(group, stationCode); + } + + /* ----------------------- 仿真新接口 ----------------------- */ + + /** + * 根据功能配置创建仿真 + */ + @PostMapping("/new/{mapId}") + public String createSimulation(@PathVariable long mapId, + @RequestBody @Validated SimulationWorkParamVO paramVO, + @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) + LoginUserInfoVO loginUserInfoVO) { + return simulationService.createSimulation(mapId, paramVO, loginUserInfoVO); + } + + /** + * 根据地图功能id创建仿真 + */ + @PostMapping("/new/mapFunction/{mapFunctionId}") + public String createSimulationByMapFunction(@PathVariable long mapFunctionId, + @RequestAttribute LoginUserInfoVO loginInfo) { + return simulationService.createSimulation(mapFunctionId, loginInfo, true).getId(); + } + + /** + * 按计划行车(新) + */ + @PostMapping("/new/{simulationId}/runAsPlan") + public void runAsPlanNew(@PathVariable String simulationId, + @RequestBody @Validated RunAsPlanParam param) { + simulationService.runAsPlan(simulationId, param); + } + + /** + * 重置仿真(新) + */ + @PutMapping("/new/{simulationId}/reset") + public void reset(@PathVariable String simulationId) { + simulationService.reset(simulationId); + Simulation simulation = simulationManager.getById(simulationId, Simulation.class); + // 写在这里为了不与加载实训时冲突,如果写入reset方法,实训加载会多次处理,会有问题 + memberManager.loadExtraMembers(simulation, null); + } + + /** + * 根据地图和功能ID获取仿真GroupId + * + * @return 仿真GroupId + */ + @GetMapping("/new/map/{mapId}/function/{functionId}") + public String querySimulationByMapIdAndMapFunction(@PathVariable("mapId") long mapId + , @PathVariable("functionId") long mapFunctionId) { + return simulationService.querySimulationByMapIdAndMapFunction(mapId, mapFunctionId); + } + + /** + * 按组织查询存在的仿真(监管仿真) + */ + @GetMapping("/supervise") + public List listSimulationByOrg( + @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO, + SimulationInfoQueryVO queryVO) { + return simulationService.listSimulationByOrg(loginUserInfoVO.getTopOrgId(), queryVO); + } + + /** + * 分页,按组织查询存在的仿真(监管仿真) + */ + @GetMapping("/paged/supervise") + public PageVO pagedSuperviseSimulation( + @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO, + SimulationInfoQueryVO queryVO) { + return simulationService.pagedSimulationByOrg(loginUserInfoVO.getTopOrgId(), queryVO); + } + + /** + * 获取所有存在的仿真 + */ + @GetMapping("/list") + public List queryInfo(SimulationInfoQueryVO queryVO) { + List simulationList = this.simulationManager.getSimulationList(); + Stream stream = simulationList.stream(); + if (StringUtils.hasText(queryVO.getGroup())) { + stream = stream.filter(simulation -> simulation.getId().contains(queryVO.getGroup())); } - - /** - * 查询所有pa系统的定时播放任务 - */ - @GetMapping("/{group}/iscs/paTimedPlay") - public List getPaTimedPlay(@PathVariable String group, String stationCode) { - return groupSimulationService.getAllPaTimedPlayInfo(group, stationCode); + if (StringUtils.hasText(queryVO.getUserName())) { + stream = stream.filter(simulation -> simulation.getSimulationUsers().stream() + .anyMatch(user -> user.getName().contains(queryVO.getUserName()))); } + return stream.map(Simulation::convertToVO).collect(Collectors.toList()); + } - /* ----------------------- 仿真新接口 ----------------------- */ + /** + * 暂停 + */ + @PutMapping("/{id}/pause") + public void pause(@PathVariable String id) { + this.simulationManager.pause(id); + } - /** - * 根据功能配置创建仿真 - */ - @Deprecated - @PostMapping("/new/{mapId}") - public String createSimulation(@PathVariable long mapId, @RequestBody @Validated SimulationWorkParamVO paramVO, - @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) - LoginUserInfoVO loginUserInfoVO) { - return simulationService.createSimulation(mapId, paramVO, loginUserInfoVO); - } + /** + * 开始 + */ + @PutMapping("/{id}/start") + public void start(@PathVariable String id) { + this.simulationManager.start(id); + } - /** - * 根据地图功能id创建仿真 - */ - @PostMapping("/new/mapFunction/{mapFunctionId}") - public String createSimulationByMapFunction(@PathVariable long mapFunctionId, - @RequestAttribute LoginUserInfoVO loginInfo) { - return simulationService.createSimulation(mapFunctionId, loginInfo, true).getId(); - } + /** + * 调整倍速 + */ + @PutMapping("/{id}/updateSpeed/{speed}") + public void updateSpeed(@PathVariable String id, @PathVariable int speed) { + this.simulationManager.updateSpeed(id, speed); + } - /** - * 按计划行车(新) - */ - @PostMapping("/new/{simulationId}/runAsPlan") - public void runAsPlanNew(@PathVariable String simulationId, - @RequestBody @Validated RunAsPlanParam param) { - simulationService.runAsPlan(simulationId, param); - } + /** + * 获取仿真中所有仿真用户 + */ + @GetMapping("/{id}/users") + public List getSimulationUsers( + @PathVariable String id) { + return this.simulationManager.getSimulationUsers(id).stream() + .map(club.joylink.rtss.simulation.SimulationUser::convertToVO) + .collect(Collectors.toList()); + } - /** - * 重置仿真(新) - */ - @PutMapping("/new/{simulationId}/reset") - public void reset(@PathVariable String simulationId) { - simulationService.reset(simulationId); - Simulation simulation = simulationManager.getById(simulationId, Simulation.class); - // 写在这里为了不与加载实训时冲突,如果写入reset方法,实训加载会多次处理,会有问题 - memberManager.loadExtraMembers(simulation, null); - } + /** + * 监控仿真 + */ + @PostMapping("/{simulationId}/monitor") + public void monitor(@PathVariable String simulationId, @RequestAttribute AccountVO user) { + simulationService.monitor(simulationId, user); + } - /** - * 根据地图和功能ID获取仿真GroupId - * - * @return 仿真GroupId - */ - @GetMapping("/new/map/{mapId}/function/{functionId}") - public String querySimulationByMapIdAndMapFunction(@PathVariable("mapId") long mapId - , @PathVariable("functionId") long mapFunctionId) { - return simulationService.querySimulationByMapIdAndMapFunction(mapId, mapFunctionId); - } + /** + * 查询"我"已加入的仿真 + */ + @GetMapping("/joined/by/me") + public SimulationVO querySimulationJoinedByMe(@RequestAttribute LoginUserInfoVO loginInfo) { + return simulationService.querySimulationJoinedByUser(loginInfo.getAccountVO().getId()); + } - /** - * 按组织查询存在的仿真(监管仿真) - */ - @GetMapping("/supervise") - public List listSimulationByOrg( - @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO, - SimulationInfoQueryVO queryVO) { - return simulationService.listSimulationByOrg(loginUserInfoVO.getTopOrgId(), queryVO); - } - - /** - * 分页,按组织查询存在的仿真(监管仿真) - */ - @GetMapping("/paged/supervise") - public PageVO pagedSuperviseSimulation( - @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO, - SimulationInfoQueryVO queryVO) { - return simulationService.pagedSimulationByOrg(loginUserInfoVO.getTopOrgId(), queryVO); - } - - /** - * 获取所有存在的仿真 - */ - @GetMapping("/list") - public List queryInfo(SimulationInfoQueryVO queryVO) { - List simulationList = this.simulationManager.getSimulationList(); - Stream stream = simulationList.stream(); - if (StringUtils.hasText(queryVO.getGroup())) { - stream = stream.filter(simulation -> simulation.getId().contains(queryVO.getGroup())); - } - if (StringUtils.hasText(queryVO.getUserName())) { - stream = stream.filter(simulation -> simulation.getSimulationUsers().stream() - .anyMatch(user -> user.getName().contains(queryVO.getUserName()))); - } - return stream.map(Simulation::convertToVO).collect(Collectors.toList()); - } - - /** - * 暂停 - */ - @PutMapping("/{id}/pause") - public void pause(@PathVariable String id) { - this.simulationManager.pause(id); - } - - /** - * 开始 - */ - @PutMapping("/{id}/start") - public void start(@PathVariable String id) { - this.simulationManager.start(id); - } - - /** - * 调整倍速 - */ - @PutMapping("/{id}/updateSpeed/{speed}") - public void updateSpeed(@PathVariable String id, @PathVariable int speed) { - this.simulationManager.updateSpeed(id, speed); - } - - /** - * 获取仿真中所有仿真用户 - */ - @GetMapping("/{id}/users") - public List getSimulationUsers( - @PathVariable String id) { - return this.simulationManager.getSimulationUsers(id).stream() - .map(club.joylink.rtss.simulation.SimulationUser::convertToVO) - .collect(Collectors.toList()); - } - - /** - * 监控仿真 - */ - @PostMapping("/{simulationId}/monitor") - public void monitor(@PathVariable String simulationId, @RequestAttribute AccountVO user) { - simulationService.monitor(simulationId, user); - } - - /** - * 查询"我"已加入的仿真 - */ - @GetMapping("/joined/by/me") - public SimulationVO querySimulationJoinedByMe(@RequestAttribute LoginUserInfoVO loginInfo) { - return simulationService.querySimulationJoinedByUser(loginInfo.getAccountVO().getId()); - } - - @GetMapping("/{simulationId}/{memberId}/unreceivedMessages") - public void sendUnreceivedMessages(@PathVariable String simulationId, - @PathVariable String memberId) { - simulationService.sendUnreceivedMessages(simulationId, memberId); - } + @GetMapping("/{simulationId}/{memberId}/unreceivedMessages") + public void sendUnreceivedMessages(@PathVariable String simulationId, + @PathVariable String memberId) { + simulationService.sendUnreceivedMessages(simulationId, memberId); + } } diff --git a/src/main/java/club/joylink/rtss/services/race/RaceApplicationService.java b/src/main/java/club/joylink/rtss/services/race/RaceApplicationService.java new file mode 100644 index 000000000..41abb6789 --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/race/RaceApplicationService.java @@ -0,0 +1,118 @@ +package club.joylink.rtss.services.race; + +import club.joylink.rtss.bo.race.RaceContent; +import club.joylink.rtss.entity.training2.DraftTraining2WithBLOBs; +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.services.training2.Training2Service; +import club.joylink.rtss.simulation.cbtc.GroupSimulationService; +import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService; +import club.joylink.rtss.simulation.cbtc.member.MemberManager; +import club.joylink.rtss.util.JsonUtils; +import club.joylink.rtss.vo.AccountVO; +import club.joylink.rtss.vo.LoginUserInfoVO; +import club.joylink.rtss.vo.paper.PaperTrainAnswerDetail; +import club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult; +import club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder; +import club.joylink.rtss.vo.race.RaceSceneOuterClass; +import club.joylink.rtss.vo.race.RaceTask; +import club.joylink.rtss.vo.race.RaceTaskFinishParamDTO; +import club.joylink.rtss.websocket.StompMessageService; +import com.google.protobuf.InvalidProtocolBufferException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +public class RaceApplicationService { + + private RacePaperService racePaperService; + private GroupSimulationService groupSimulationService; + private MemberManager memberManager; + private SimulationLifeCycleService simulationLifeCycleService; + private ApplicationContext applicationContext; + private StompMessageService stompMessageService; + private Training2Service training2Service; + private RaceSceneService raceSceneService; + + private static final Map raceContentMap = new HashMap<>(); + + /** + * 开始训练 + * + * @return 模块任务树 + */ + public RaceTask.RacePaperSingleModuleGroupTask start(long paperId, int moduleId, long userId) { + RaceContent content = new RaceContent(userId, paperId, moduleId, + racePaperService.singlePaperModuleTask(paperId, moduleId)); + RaceContent oldContent = raceContentMap.put(userId, content); + if (oldContent != null) { + log.info("用户[%d]开始了[赛题:{}|模块:{}]的训练,并且覆盖了就训练", paperId, moduleId); + } else { + log.info("用户[%d]开始了[赛题:{}|模块:{}]的训练", paperId, moduleId); + } + return content.getTaskTree(); + } + + public void loadScene(String simulationId, long sceneId, LoginUserInfoVO loginInfo) { + RaceContent content = getContent(loginInfo.getAccountVO().getId()); + //获取场景数据 + RaceSceneOuterClass.StorageSimulation scene; + try { + scene = RaceSceneOuterClass.Scene + .parseFrom(raceSceneService.findById(sceneId).getProto()).getStorageSimulation(); + } catch (InvalidProtocolBufferException e) { + throw BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.exception("场景数据解析出错", e); + } + //场景数据转实训数据 + DraftTraining2WithBLOBs draftTraining2 = new DraftTraining2WithBLOBs(); + draftTraining2.setBgSceneJson(scene.getBgSceneJson()); +// draftTraining2.setOperaJson(scene.get); operaJson没了 + draftTraining2.setStepJson(scene.getStepJson()); + draftTraining2.setScoringRuleJson(scene.getScoringRuleJson()); + draftTraining2.setMemberJson(scene.getMemberJson()); + draftTraining2.setPlayerIdJson(JsonUtils.writeValueAsString(scene.getPlayerIdsList())); +// draftTraining2.setClient(scene); client没了 + training2Service.trainingDataValid.accept(draftTraining2); + //加载实训 + training2Service.simulationLoadTraining(simulationId, draftTraining2, loginInfo); + } + + public void finishTask(long taskId, RaceTaskFinishParamDTO paramDTO, AccountVO user) { + if (paramDTO == null) { + return; + } + RaceContent content = getContent(user.getId()); + List result = training2Service.finishTraining2( + paramDTO.getSimulationId(), user, paramDTO.getScoreList()); + Builder resultNode = content.getResultNode(taskId); + int fullScore = 0; + int score = 0; + for (PaperTrainAnswerDetail paperTrainAnswerDetail : result) { + fullScore += paperTrainAnswerDetail.getRuleScore(); + score += paperTrainAnswerDetail.getScore(); + } + resultNode.setFullScore(fullScore); + resultNode.setScore(score); + } + + public RacePracticeResult finish(long userId) { + RaceContent content = getContent(userId); + RacePracticeResult result = content.getResult().build(); + raceContentMap.remove(userId); + log.info("用户[{}]完成[赛题:{} | 模块:{}]", userId, content.getPaperId(), + content.getModuleId()); + return result; + } + + private RaceContent getContent(long userId) { + RaceContent content = raceContentMap.get(userId); + BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(content, + String.format("未找到用户[%d]的训练上下文", userId)); + return content; + } +} + diff --git a/src/main/java/club/joylink/rtss/services/race/RaceTaskService.java b/src/main/java/club/joylink/rtss/services/race/RaceTaskService.java index 1acede879..56aabe2a8 100644 --- a/src/main/java/club/joylink/rtss/services/race/RaceTaskService.java +++ b/src/main/java/club/joylink/rtss/services/race/RaceTaskService.java @@ -4,12 +4,10 @@ import club.joylink.rtss.dao.racetr.RacetrTaskDAO; import club.joylink.rtss.entity.racetr.RacetrTask; import club.joylink.rtss.entity.racetr.RacetrTaskExample; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; -import club.joylink.rtss.services.ISysUserService; import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.common.ModifyInfo.ModifyInfoVO; import club.joylink.rtss.vo.race.RaceTask.RaceTaskBind; import club.joylink.rtss.vo.race.RaceTask.RaceTaskBind.TaskBindType; - import club.joylink.rtss.vo.race.RaceTask.RaceTaskCreateVO; import club.joylink.rtss.vo.race.RaceTask.RaceTaskDetailVO; import club.joylink.rtss.vo.race.RaceTaskDetailDTO; @@ -40,14 +38,17 @@ public class RaceTaskService { private RacetrTask findById(Long id) { RacetrTask task = this.raceTaskDAO.selectByPrimaryKey(id); - BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(task), "没有找到对应的任务"); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(task), + "没有找到对应的任务"); return task; } public RaceTaskDetailVO detail(Long id) { - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(id), "请选择对应的任务"); + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(id), + "请选择对应的任务"); RaceTaskDetailDTO task = this.raceTaskDAO.details(id); - BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(task), "未找到对应的任务数据"); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(task), + "未找到对应的任务数据"); RaceTaskDetailVO.Builder vo = RaceTaskDetailVO.newBuilder(); vo.setId(task.getId()); @@ -56,7 +57,9 @@ public class RaceTaskService { vo.setContent(task.getContent()); vo.setStandards(task.getStandards()); vo.setParentId(task.getParentId()); - ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(task.getCreatorId(), task.getCreatorName(), task.getUpdaterId(), task.getUpdaterName(), task.getCreateTime(), task.getUpdateTime()); + ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(task.getCreatorId(), + task.getCreatorName(), task.getUpdaterId(), task.getUpdaterName(), task.getCreateTime(), + task.getUpdateTime()); vo.setModifyInfo(modifyInfoVO); if (Objects.nonNull(task.getSceneId())) { vo.setSceneId(task.getSceneId()); @@ -97,11 +100,14 @@ public class RaceTaskService { } public void bind(Long taskId, List bind, AccountVO user) { - BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(!CollectionUtils.isEmpty(bind), "请选择要绑定的数据"); + BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(!CollectionUtils.isEmpty(bind), + "请选择要绑定的数据"); BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(bind.size() <= 2, "最多绑定只能选择2个类型"); if (bind.size() > 1) { - List bindTypes = bind.stream().map(RaceTaskBind::getBindType).distinct().collect(Collectors.toList()); - BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(bindTypes.size() != 1, "最多绑定只能选择2个类型"); + List bindTypes = bind.stream().map(RaceTaskBind::getBindType).distinct() + .collect(Collectors.toList()); + BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(bindTypes.size() != 1, + "最多绑定只能选择2个类型"); } RacetrTask task = this.findById(taskId); @@ -130,7 +136,8 @@ public class RaceTaskService { public List tree() { List taskList = this.raceTaskDAO.selectByExample(null); - Map> mapList = taskList.stream().map(RaceTaskTreeVO::new).collect(Collectors.groupingBy(RaceTaskTreeVO::getParentId)); + Map> mapList = taskList.stream().map(RaceTaskTreeVO::new) + .collect(Collectors.groupingBy(RaceTaskTreeVO::getParentId)); List rootTaskList = mapList.get(TASK_ROOT_ID); if (CollectionUtils.isEmpty(rootTaskList)) { return Collections.emptyList(); @@ -163,7 +170,8 @@ public class RaceTaskService { List collection = Lists.newArrayList(new RaceTaskTreeVO(rt)); this.collectAllChildren(rt.getId(), collection); - List deleteIds = collection.stream().map(RaceTaskTreeVO::getId).distinct().collect(Collectors.toList()); + List deleteIds = collection.stream().map(RaceTaskTreeVO::getId).distinct() + .collect(Collectors.toList()); log.info("删除任务[{}] 对应所有的子节点id[{}]", id, deleteIds); RacetrTaskExample example = new RacetrTaskExample(); example.createCriteria().andIdIn(deleteIds); @@ -188,7 +196,8 @@ public class RaceTaskService { */ public Map> recursiveFindTask(List taskIds) { List taskDtoList = this.raceTaskDAO.recursiveFindTask(taskIds); - Map> dtoMapList = taskDtoList.stream().collect(Collectors.groupingBy(RaceTaskDetailDTO::getParentId)); + Map> dtoMapList = taskDtoList.stream() + .collect(Collectors.groupingBy(RaceTaskDetailDTO::getParentId)); return dtoMapList; } } diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java index abb141394..8b9c2d7d3 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java @@ -637,7 +637,7 @@ public class Training2Service { /** * 仿真加载实训 初始化仿真 -》 替换实训信息 -》 加载背景 */ - private void simulationLoadTraining(String group, DraftTraining2WithBLOBs draftTraining2, + public void simulationLoadTraining(String group, DraftTraining2WithBLOBs draftTraining2, LoginUserInfoVO loginUserInfoVO) { Simulation simulation = groupSimulationCache.getSimulationByGroup(group); // 重置仿真状态 @@ -931,7 +931,7 @@ public class Training2Service { /** * 检验实训数据是否合规 */ - private Consumer trainingDataValid = (training) -> { + public Consumer trainingDataValid = (training) -> { if (!StringUtils.hasText(training.getPlayerIdJson())) { throw new SimulationException(SimulationExceptionType.Invalid_Operation , String.format("实训{id:[%s]}没有参训角色", training.getId())); diff --git a/src/main/java/club/joylink/rtss/vo/common/ModifyInfo.java b/src/main/java/club/joylink/rtss/vo/common/ModifyInfo.java index 0cf866761..7734e7bb3 100644 --- a/src/main/java/club/joylink/rtss/vo/common/ModifyInfo.java +++ b/src/main/java/club/joylink/rtss/vo/common/ModifyInfo.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: modify_info.proto +// source: common/modify_info.proto package club.joylink.rtss.vo.common; @@ -1146,12 +1146,12 @@ public final class ModifyInfo { descriptor; static { java.lang.String[] descriptorData = { - "\n\021modify_info.proto\022\006common\"\214\001\n\014ModifyIn" + - "foVO\022\022\n\ncreator_id\030\001 \001(\003\022\023\n\013create_time\030" + - "\002 \001(\t\022\022\n\nupdater_id\030\003 \001(\003\022\023\n\013update_time" + - "\030\004 \001(\t\022\024\n\014creator_name\030\005 \001(\t\022\024\n\014updater_" + - "name\030\006 \001(\tB\035\n\033club.joylink.rtss.vo.commo" + - "nb\006proto3" + "\n\030common/modify_info.proto\022\006common\"\214\001\n\014M" + + "odifyInfoVO\022\022\n\ncreator_id\030\001 \001(\003\022\023\n\013creat" + + "e_time\030\002 \001(\t\022\022\n\nupdater_id\030\003 \001(\003\022\023\n\013upda" + + "te_time\030\004 \001(\t\022\024\n\014creator_name\030\005 \001(\t\022\024\n\014u" + + "pdater_name\030\006 \001(\tB\035\n\033club.joylink.rtss.v" + + "o.commonb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/src/main/java/club/joylink/rtss/vo/common/PageQuery.java b/src/main/java/club/joylink/rtss/vo/common/PageQuery.java index 171e84de7..1cdd15a8f 100644 --- a/src/main/java/club/joylink/rtss/vo/common/PageQuery.java +++ b/src/main/java/club/joylink/rtss/vo/common/PageQuery.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: page_query.proto +// source: common/page_query.proto package club.joylink.rtss.vo.common; @@ -552,9 +552,9 @@ public final class PageQuery { descriptor; static { java.lang.String[] descriptorData = { - "\n\020page_query.proto\022\006common\")\n\013PageQueryV" + - "O\022\014\n\004page\030\001 \001(\005\022\014\n\004size\030\002 \001(\005B\035\n\033club.jo" + - "ylink.rtss.vo.commonb\006proto3" + "\n\027common/page_query.proto\022\006common\")\n\013Pag" + + "eQueryVO\022\014\n\004page\030\001 \001(\005\022\014\n\004size\030\002 \001(\005B\035\n\033" + + "club.joylink.rtss.vo.commonb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/src/main/java/club/joylink/rtss/vo/race/RaceApplication.java b/src/main/java/club/joylink/rtss/vo/race/RaceApplication.java new file mode 100644 index 000000000..352117a53 --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/race/RaceApplication.java @@ -0,0 +1,2048 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: race/race_application.proto + +package club.joylink.rtss.vo.race; + +public final class RaceApplication { + private RaceApplication() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface RacePracticeResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:race.RacePracticeResult) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 custom_module_id = 1; + * @return The customModuleId. + */ + int getCustomModuleId(); + + /** + * repeated .race.ResultNode node = 2; + */ + java.util.List + getNodeList(); + /** + * repeated .race.ResultNode node = 2; + */ + club.joylink.rtss.vo.race.RaceApplication.ResultNode getNode(int index); + /** + * repeated .race.ResultNode node = 2; + */ + int getNodeCount(); + /** + * repeated .race.ResultNode node = 2; + */ + java.util.List + getNodeOrBuilderList(); + /** + * repeated .race.ResultNode node = 2; + */ + club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder getNodeOrBuilder( + int index); + } + /** + *

+   *模块训练结果
+   * 
+ * + * Protobuf type {@code race.RacePracticeResult} + */ + public static final class RacePracticeResult extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:race.RacePracticeResult) + RacePracticeResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use RacePracticeResult.newBuilder() to construct. + private RacePracticeResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RacePracticeResult() { + node_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RacePracticeResult(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_RacePracticeResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_RacePracticeResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult.class, club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult.Builder.class); + } + + public static final int CUSTOM_MODULE_ID_FIELD_NUMBER = 1; + private int customModuleId_ = 0; + /** + * int32 custom_module_id = 1; + * @return The customModuleId. + */ + @java.lang.Override + public int getCustomModuleId() { + return customModuleId_; + } + + public static final int NODE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List node_; + /** + * repeated .race.ResultNode node = 2; + */ + @java.lang.Override + public java.util.List getNodeList() { + return node_; + } + /** + * repeated .race.ResultNode node = 2; + */ + @java.lang.Override + public java.util.List + getNodeOrBuilderList() { + return node_; + } + /** + * repeated .race.ResultNode node = 2; + */ + @java.lang.Override + public int getNodeCount() { + return node_.size(); + } + /** + * repeated .race.ResultNode node = 2; + */ + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.ResultNode getNode(int index) { + return node_.get(index); + } + /** + * repeated .race.ResultNode node = 2; + */ + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder getNodeOrBuilder( + int index) { + return node_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (customModuleId_ != 0) { + output.writeInt32(1, customModuleId_); + } + for (int i = 0; i < node_.size(); i++) { + output.writeMessage(2, node_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (customModuleId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, customModuleId_); + } + for (int i = 0; i < node_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, node_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult)) { + return super.equals(obj); + } + club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult other = (club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult) obj; + + if (getCustomModuleId() + != other.getCustomModuleId()) return false; + if (!getNodeList() + .equals(other.getNodeList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CUSTOM_MODULE_ID_FIELD_NUMBER; + hash = (53 * hash) + getCustomModuleId(); + if (getNodeCount() > 0) { + hash = (37 * hash) + NODE_FIELD_NUMBER; + hash = (53 * hash) + getNodeList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     *模块训练结果
+     * 
+ * + * Protobuf type {@code race.RacePracticeResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:race.RacePracticeResult) + club.joylink.rtss.vo.race.RaceApplication.RacePracticeResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_RacePracticeResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_RacePracticeResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult.class, club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult.Builder.class); + } + + // Construct using club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + customModuleId_ = 0; + if (nodeBuilder_ == null) { + node_ = java.util.Collections.emptyList(); + } else { + node_ = null; + nodeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_RacePracticeResult_descriptor; + } + + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult getDefaultInstanceForType() { + return club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult.getDefaultInstance(); + } + + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult build() { + club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult buildPartial() { + club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult result = new club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult result) { + if (nodeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + node_ = java.util.Collections.unmodifiableList(node_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.node_ = node_; + } else { + result.node_ = nodeBuilder_.build(); + } + } + + private void buildPartial0(club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.customModuleId_ = customModuleId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult) { + return mergeFrom((club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult other) { + if (other == club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult.getDefaultInstance()) return this; + if (other.getCustomModuleId() != 0) { + setCustomModuleId(other.getCustomModuleId()); + } + if (nodeBuilder_ == null) { + if (!other.node_.isEmpty()) { + if (node_.isEmpty()) { + node_ = other.node_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNodeIsMutable(); + node_.addAll(other.node_); + } + onChanged(); + } + } else { + if (!other.node_.isEmpty()) { + if (nodeBuilder_.isEmpty()) { + nodeBuilder_.dispose(); + nodeBuilder_ = null; + node_ = other.node_; + bitField0_ = (bitField0_ & ~0x00000002); + nodeBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNodeFieldBuilder() : null; + } else { + nodeBuilder_.addAllMessages(other.node_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + customModuleId_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + club.joylink.rtss.vo.race.RaceApplication.ResultNode m = + input.readMessage( + club.joylink.rtss.vo.race.RaceApplication.ResultNode.parser(), + extensionRegistry); + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(m); + } else { + nodeBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int customModuleId_ ; + /** + * int32 custom_module_id = 1; + * @return The customModuleId. + */ + @java.lang.Override + public int getCustomModuleId() { + return customModuleId_; + } + /** + * int32 custom_module_id = 1; + * @param value The customModuleId to set. + * @return This builder for chaining. + */ + public Builder setCustomModuleId(int value) { + + customModuleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 custom_module_id = 1; + * @return This builder for chaining. + */ + public Builder clearCustomModuleId() { + bitField0_ = (bitField0_ & ~0x00000001); + customModuleId_ = 0; + onChanged(); + return this; + } + + private java.util.List node_ = + java.util.Collections.emptyList(); + private void ensureNodeIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + node_ = new java.util.ArrayList(node_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.rtss.vo.race.RaceApplication.ResultNode, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder, club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder> nodeBuilder_; + + /** + * repeated .race.ResultNode node = 2; + */ + public java.util.List getNodeList() { + if (nodeBuilder_ == null) { + return java.util.Collections.unmodifiableList(node_); + } else { + return nodeBuilder_.getMessageList(); + } + } + /** + * repeated .race.ResultNode node = 2; + */ + public int getNodeCount() { + if (nodeBuilder_ == null) { + return node_.size(); + } else { + return nodeBuilder_.getCount(); + } + } + /** + * repeated .race.ResultNode node = 2; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNode getNode(int index) { + if (nodeBuilder_ == null) { + return node_.get(index); + } else { + return nodeBuilder_.getMessage(index); + } + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder setNode( + int index, club.joylink.rtss.vo.race.RaceApplication.ResultNode value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.set(index, value); + onChanged(); + } else { + nodeBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder setNode( + int index, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder addNode(club.joylink.rtss.vo.race.RaceApplication.ResultNode value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.add(value); + onChanged(); + } else { + nodeBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder addNode( + int index, club.joylink.rtss.vo.race.RaceApplication.ResultNode value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.add(index, value); + onChanged(); + } else { + nodeBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder addNode( + club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder addNode( + int index, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder addAllNode( + java.lang.Iterable values) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, node_); + onChanged(); + } else { + nodeBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder clearNode() { + if (nodeBuilder_ == null) { + node_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + nodeBuilder_.clear(); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public Builder removeNode(int index) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.remove(index); + onChanged(); + } else { + nodeBuilder_.remove(index); + } + return this; + } + /** + * repeated .race.ResultNode node = 2; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder getNodeBuilder( + int index) { + return getNodeFieldBuilder().getBuilder(index); + } + /** + * repeated .race.ResultNode node = 2; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder getNodeOrBuilder( + int index) { + if (nodeBuilder_ == null) { + return node_.get(index); } else { + return nodeBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .race.ResultNode node = 2; + */ + public java.util.List + getNodeOrBuilderList() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(node_); + } + } + /** + * repeated .race.ResultNode node = 2; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder addNodeBuilder() { + return getNodeFieldBuilder().addBuilder( + club.joylink.rtss.vo.race.RaceApplication.ResultNode.getDefaultInstance()); + } + /** + * repeated .race.ResultNode node = 2; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder addNodeBuilder( + int index) { + return getNodeFieldBuilder().addBuilder( + index, club.joylink.rtss.vo.race.RaceApplication.ResultNode.getDefaultInstance()); + } + /** + * repeated .race.ResultNode node = 2; + */ + public java.util.List + getNodeBuilderList() { + return getNodeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.rtss.vo.race.RaceApplication.ResultNode, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder, club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.rtss.vo.race.RaceApplication.ResultNode, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder, club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder>( + node_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + node_ = null; + } + return nodeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:race.RacePracticeResult) + } + + // @@protoc_insertion_point(class_scope:race.RacePracticeResult) + private static final club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult(); + } + + public static club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RacePracticeResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.RacePracticeResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ResultNodeOrBuilder extends + // @@protoc_insertion_point(interface_extends:race.ResultNode) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * float fullScore = 2; + * @return The fullScore. + */ + float getFullScore(); + + /** + * float score = 3; + * @return The score. + */ + float getScore(); + + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @return The type. + */ + club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType getType(); + + /** + * repeated .race.ResultNode child = 5; + */ + java.util.List + getChildList(); + /** + * repeated .race.ResultNode child = 5; + */ + club.joylink.rtss.vo.race.RaceApplication.ResultNode getChild(int index); + /** + * repeated .race.ResultNode child = 5; + */ + int getChildCount(); + /** + * repeated .race.ResultNode child = 5; + */ + java.util.List + getChildOrBuilderList(); + /** + * repeated .race.ResultNode child = 5; + */ + club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder getChildOrBuilder( + int index); + } + /** + * Protobuf type {@code race.ResultNode} + */ + public static final class ResultNode extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:race.ResultNode) + ResultNodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResultNode.newBuilder() to construct. + private ResultNode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ResultNode() { + name_ = ""; + type_ = 0; + child_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ResultNode(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_ResultNode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_ResultNode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + club.joylink.rtss.vo.race.RaceApplication.ResultNode.class, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FULLSCORE_FIELD_NUMBER = 2; + private float fullScore_ = 0F; + /** + * float fullScore = 2; + * @return The fullScore. + */ + @java.lang.Override + public float getFullScore() { + return fullScore_; + } + + public static final int SCORE_FIELD_NUMBER = 3; + private float score_ = 0F; + /** + * float score = 3; + * @return The score. + */ + @java.lang.Override + public float getScore() { + return score_; + } + + public static final int TYPE_FIELD_NUMBER = 4; + private int type_ = 0; + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @return The type. + */ + @java.lang.Override public club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType getType() { + club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType result = club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType.forNumber(type_); + return result == null ? club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType.UNRECOGNIZED : result; + } + + public static final int CHILD_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List child_; + /** + * repeated .race.ResultNode child = 5; + */ + @java.lang.Override + public java.util.List getChildList() { + return child_; + } + /** + * repeated .race.ResultNode child = 5; + */ + @java.lang.Override + public java.util.List + getChildOrBuilderList() { + return child_; + } + /** + * repeated .race.ResultNode child = 5; + */ + @java.lang.Override + public int getChildCount() { + return child_.size(); + } + /** + * repeated .race.ResultNode child = 5; + */ + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.ResultNode getChild(int index) { + return child_.get(index); + } + /** + * repeated .race.ResultNode child = 5; + */ + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder getChildOrBuilder( + int index) { + return child_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (java.lang.Float.floatToRawIntBits(fullScore_) != 0) { + output.writeFloat(2, fullScore_); + } + if (java.lang.Float.floatToRawIntBits(score_) != 0) { + output.writeFloat(3, score_); + } + if (type_ != club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType.MODULE_GROUP.getNumber()) { + output.writeEnum(4, type_); + } + for (int i = 0; i < child_.size(); i++) { + output.writeMessage(5, child_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (java.lang.Float.floatToRawIntBits(fullScore_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, fullScore_); + } + if (java.lang.Float.floatToRawIntBits(score_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, score_); + } + if (type_ != club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType.MODULE_GROUP.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, type_); + } + for (int i = 0; i < child_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, child_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof club.joylink.rtss.vo.race.RaceApplication.ResultNode)) { + return super.equals(obj); + } + club.joylink.rtss.vo.race.RaceApplication.ResultNode other = (club.joylink.rtss.vo.race.RaceApplication.ResultNode) obj; + + if (!getName() + .equals(other.getName())) return false; + if (java.lang.Float.floatToIntBits(getFullScore()) + != java.lang.Float.floatToIntBits( + other.getFullScore())) return false; + if (java.lang.Float.floatToIntBits(getScore()) + != java.lang.Float.floatToIntBits( + other.getScore())) return false; + if (type_ != other.type_) return false; + if (!getChildList() + .equals(other.getChildList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FULLSCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFullScore()); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (getChildCount() > 0) { + hash = (37 * hash) + CHILD_FIELD_NUMBER; + hash = (53 * hash) + getChildList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(club.joylink.rtss.vo.race.RaceApplication.ResultNode prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code race.ResultNode} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:race.ResultNode) + club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_ResultNode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_ResultNode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + club.joylink.rtss.vo.race.RaceApplication.ResultNode.class, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder.class); + } + + // Construct using club.joylink.rtss.vo.race.RaceApplication.ResultNode.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + fullScore_ = 0F; + score_ = 0F; + type_ = 0; + if (childBuilder_ == null) { + child_ = java.util.Collections.emptyList(); + } else { + child_ = null; + childBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return club.joylink.rtss.vo.race.RaceApplication.internal_static_race_ResultNode_descriptor; + } + + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.ResultNode getDefaultInstanceForType() { + return club.joylink.rtss.vo.race.RaceApplication.ResultNode.getDefaultInstance(); + } + + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.ResultNode build() { + club.joylink.rtss.vo.race.RaceApplication.ResultNode result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.ResultNode buildPartial() { + club.joylink.rtss.vo.race.RaceApplication.ResultNode result = new club.joylink.rtss.vo.race.RaceApplication.ResultNode(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(club.joylink.rtss.vo.race.RaceApplication.ResultNode result) { + if (childBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + child_ = java.util.Collections.unmodifiableList(child_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.child_ = child_; + } else { + result.child_ = childBuilder_.build(); + } + } + + private void buildPartial0(club.joylink.rtss.vo.race.RaceApplication.ResultNode result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fullScore_ = fullScore_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.score_ = score_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof club.joylink.rtss.vo.race.RaceApplication.ResultNode) { + return mergeFrom((club.joylink.rtss.vo.race.RaceApplication.ResultNode)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(club.joylink.rtss.vo.race.RaceApplication.ResultNode other) { + if (other == club.joylink.rtss.vo.race.RaceApplication.ResultNode.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFullScore() != 0F) { + setFullScore(other.getFullScore()); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (childBuilder_ == null) { + if (!other.child_.isEmpty()) { + if (child_.isEmpty()) { + child_ = other.child_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureChildIsMutable(); + child_.addAll(other.child_); + } + onChanged(); + } + } else { + if (!other.child_.isEmpty()) { + if (childBuilder_.isEmpty()) { + childBuilder_.dispose(); + childBuilder_ = null; + child_ = other.child_; + bitField0_ = (bitField0_ & ~0x00000010); + childBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getChildFieldBuilder() : null; + } else { + childBuilder_.addAllMessages(other.child_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: { + fullScore_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + score_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 32: { + type_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + club.joylink.rtss.vo.race.RaceApplication.ResultNode m = + input.readMessage( + club.joylink.rtss.vo.race.RaceApplication.ResultNode.parser(), + extensionRegistry); + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.add(m); + } else { + childBuilder_.addMessage(m); + } + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float fullScore_ ; + /** + * float fullScore = 2; + * @return The fullScore. + */ + @java.lang.Override + public float getFullScore() { + return fullScore_; + } + /** + * float fullScore = 2; + * @param value The fullScore to set. + * @return This builder for chaining. + */ + public Builder setFullScore(float value) { + + fullScore_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * float fullScore = 2; + * @return This builder for chaining. + */ + public Builder clearFullScore() { + bitField0_ = (bitField0_ & ~0x00000002); + fullScore_ = 0F; + onChanged(); + return this; + } + + private float score_ ; + /** + * float score = 3; + * @return The score. + */ + @java.lang.Override + public float getScore() { + return score_; + } + /** + * float score = 3; + * @param value The score to set. + * @return This builder for chaining. + */ + public Builder setScore(float value) { + + score_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * float score = 3; + * @return This builder for chaining. + */ + public Builder clearScore() { + bitField0_ = (bitField0_ & ~0x00000004); + score_ = 0F; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @return The type. + */ + @java.lang.Override + public club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType getType() { + club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType result = club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType.forNumber(type_); + return result == null ? club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType.UNRECOGNIZED : result; + } + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .race.RaceTaskChildVO.ChildNodeType type = 4; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 0; + onChanged(); + return this; + } + + private java.util.List child_ = + java.util.Collections.emptyList(); + private void ensureChildIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + child_ = new java.util.ArrayList(child_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.rtss.vo.race.RaceApplication.ResultNode, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder, club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder> childBuilder_; + + /** + * repeated .race.ResultNode child = 5; + */ + public java.util.List getChildList() { + if (childBuilder_ == null) { + return java.util.Collections.unmodifiableList(child_); + } else { + return childBuilder_.getMessageList(); + } + } + /** + * repeated .race.ResultNode child = 5; + */ + public int getChildCount() { + if (childBuilder_ == null) { + return child_.size(); + } else { + return childBuilder_.getCount(); + } + } + /** + * repeated .race.ResultNode child = 5; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNode getChild(int index) { + if (childBuilder_ == null) { + return child_.get(index); + } else { + return childBuilder_.getMessage(index); + } + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder setChild( + int index, club.joylink.rtss.vo.race.RaceApplication.ResultNode value) { + if (childBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildIsMutable(); + child_.set(index, value); + onChanged(); + } else { + childBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder setChild( + int index, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder builderForValue) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.set(index, builderForValue.build()); + onChanged(); + } else { + childBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder addChild(club.joylink.rtss.vo.race.RaceApplication.ResultNode value) { + if (childBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildIsMutable(); + child_.add(value); + onChanged(); + } else { + childBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder addChild( + int index, club.joylink.rtss.vo.race.RaceApplication.ResultNode value) { + if (childBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildIsMutable(); + child_.add(index, value); + onChanged(); + } else { + childBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder addChild( + club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder builderForValue) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.add(builderForValue.build()); + onChanged(); + } else { + childBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder addChild( + int index, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder builderForValue) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.add(index, builderForValue.build()); + onChanged(); + } else { + childBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder addAllChild( + java.lang.Iterable values) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, child_); + onChanged(); + } else { + childBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder clearChild() { + if (childBuilder_ == null) { + child_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + childBuilder_.clear(); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public Builder removeChild(int index) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.remove(index); + onChanged(); + } else { + childBuilder_.remove(index); + } + return this; + } + /** + * repeated .race.ResultNode child = 5; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder getChildBuilder( + int index) { + return getChildFieldBuilder().getBuilder(index); + } + /** + * repeated .race.ResultNode child = 5; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder getChildOrBuilder( + int index) { + if (childBuilder_ == null) { + return child_.get(index); } else { + return childBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .race.ResultNode child = 5; + */ + public java.util.List + getChildOrBuilderList() { + if (childBuilder_ != null) { + return childBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(child_); + } + } + /** + * repeated .race.ResultNode child = 5; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder addChildBuilder() { + return getChildFieldBuilder().addBuilder( + club.joylink.rtss.vo.race.RaceApplication.ResultNode.getDefaultInstance()); + } + /** + * repeated .race.ResultNode child = 5; + */ + public club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder addChildBuilder( + int index) { + return getChildFieldBuilder().addBuilder( + index, club.joylink.rtss.vo.race.RaceApplication.ResultNode.getDefaultInstance()); + } + /** + * repeated .race.ResultNode child = 5; + */ + public java.util.List + getChildBuilderList() { + return getChildFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.rtss.vo.race.RaceApplication.ResultNode, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder, club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder> + getChildFieldBuilder() { + if (childBuilder_ == null) { + childBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.rtss.vo.race.RaceApplication.ResultNode, club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder, club.joylink.rtss.vo.race.RaceApplication.ResultNodeOrBuilder>( + child_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + child_ = null; + } + return childBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:race.ResultNode) + } + + // @@protoc_insertion_point(class_scope:race.ResultNode) + private static final club.joylink.rtss.vo.race.RaceApplication.ResultNode DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new club.joylink.rtss.vo.race.RaceApplication.ResultNode(); + } + + public static club.joylink.rtss.vo.race.RaceApplication.ResultNode getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResultNode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public club.joylink.rtss.vo.race.RaceApplication.ResultNode getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_race_RacePracticeResult_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_race_RacePracticeResult_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_race_ResultNode_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_race_ResultNode_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\033race/race_application.proto\022\004race\032\024rac" + + "e/race_task.proto\"N\n\022RacePracticeResult\022" + + "\030\n\020custom_module_id\030\001 \001(\005\022\036\n\004node\030\002 \003(\0132" + + "\020.race.ResultNode\"\220\001\n\nResultNode\022\014\n\004name" + + "\030\001 \001(\t\022\021\n\tfullScore\030\002 \001(\002\022\r\n\005score\030\003 \001(\002" + + "\0221\n\004type\030\004 \001(\0162#.race.RaceTaskChildVO.Ch" + + "ildNodeType\022\037\n\005child\030\005 \003(\0132\020.race.Result" + + "NodeB\033\n\031club.joylink.rtss.vo.raceb\006proto" + + "3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + club.joylink.rtss.vo.race.RaceTask.getDescriptor(), + }); + internal_static_race_RacePracticeResult_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_race_RacePracticeResult_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_race_RacePracticeResult_descriptor, + new java.lang.String[] { "CustomModuleId", "Node", }); + internal_static_race_ResultNode_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_race_ResultNode_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_race_ResultNode_descriptor, + new java.lang.String[] { "Name", "FullScore", "Score", "Type", "Child", }); + club.joylink.rtss.vo.race.RaceTask.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/club/joylink/rtss/vo/race/RaceModule.java b/src/main/java/club/joylink/rtss/vo/race/RaceModule.java index cf4c38679..3f85d4a93 100644 --- a/src/main/java/club/joylink/rtss/vo/race/RaceModule.java +++ b/src/main/java/club/joylink/rtss/vo/race/RaceModule.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: race_module.proto +// source: race/race_module.proto package club.joylink.rtss.vo.race; @@ -5593,23 +5593,23 @@ public final class RaceModule { descriptor; static { java.lang.String[] descriptorData = { - "\n\021race_module.proto\022\004race\032\030common/modify" + - "_info.proto\"\256\001\n\014RaceModuleVO\022\n\n\002id\030\001 \001(\003" + - "\022\014\n\004code\030\003 \001(\t\022\014\n\004desc\030\004 \001(\t\022\020\n\010paper_id" + - "\030\005 \001(\003\022\'\n\014task_setting\030\006 \001(\0132\021.race.Task" + - "Setting\022\020\n\010duration\030\007 \001(\005\022)\n\013modify_info" + - "\030\010 \001(\0132\024.common.ModifyInfoVO\"\235\001\n\020RaceMod" + - "uleListVO\022\n\n\002id\030\001 \001(\003\022\014\n\004code\030\003 \001(\t\022\014\n\004d" + - "esc\030\004 \001(\t\022\020\n\010paper_id\030\005 \001(\003\022\022\n\npaper_nam" + - "e\030\006 \001(\t\022\020\n\010duration\030\007 \001(\005\022)\n\013modify_info" + - "\030\010 \001(\0132\024.common.ModifyInfoVO\"T\n\022RaceModu" + - "leCreateVO\022\014\n\004code\030\001 \001(\t\022\014\n\004desc\030\002 \001(\t\022\020" + - "\n\010paper_id\030\003 \001(\003\022\020\n\010duration\030\004 \001(\005\"\206\001\n\013T" + - "askSetting\022&\n\005group\030\002 \003(\0132\027.race.TaskSet" + - "ting.Group\032O\n\005Group\022\020\n\010task_ids\030\001 \003(\003\022&\n" + - "\005group\030\002 \003(\0132\027.race.TaskSetting.Group\022\014\n" + - "\004name\030\003 \001(\tB\033\n\031club.joylink.rtss.vo.race" + - "b\006proto3" + "\n\026race/race_module.proto\022\004race\032\030common/m" + + "odify_info.proto\"\256\001\n\014RaceModuleVO\022\n\n\002id\030" + + "\001 \001(\003\022\014\n\004code\030\003 \001(\t\022\014\n\004desc\030\004 \001(\t\022\020\n\010pap" + + "er_id\030\005 \001(\003\022\'\n\014task_setting\030\006 \001(\0132\021.race" + + ".TaskSetting\022\020\n\010duration\030\007 \001(\005\022)\n\013modify" + + "_info\030\010 \001(\0132\024.common.ModifyInfoVO\"\235\001\n\020Ra" + + "ceModuleListVO\022\n\n\002id\030\001 \001(\003\022\014\n\004code\030\003 \001(\t" + + "\022\014\n\004desc\030\004 \001(\t\022\020\n\010paper_id\030\005 \001(\003\022\022\n\npape" + + "r_name\030\006 \001(\t\022\020\n\010duration\030\007 \001(\005\022)\n\013modify" + + "_info\030\010 \001(\0132\024.common.ModifyInfoVO\"T\n\022Rac" + + "eModuleCreateVO\022\014\n\004code\030\001 \001(\t\022\014\n\004desc\030\002 " + + "\001(\t\022\020\n\010paper_id\030\003 \001(\003\022\020\n\010duration\030\004 \001(\005\"" + + "\206\001\n\013TaskSetting\022&\n\005group\030\002 \003(\0132\027.race.Ta" + + "skSetting.Group\032O\n\005Group\022\020\n\010task_ids\030\001 \003" + + "(\003\022&\n\005group\030\002 \003(\0132\027.race.TaskSetting.Gro" + + "up\022\014\n\004name\030\003 \001(\tB\033\n\031club.joylink.rtss.vo" + + ".raceb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/src/main/java/club/joylink/rtss/vo/race/RacePaper.java b/src/main/java/club/joylink/rtss/vo/race/RacePaper.java index 389bb4b2a..af6e4d770 100644 --- a/src/main/java/club/joylink/rtss/vo/race/RacePaper.java +++ b/src/main/java/club/joylink/rtss/vo/race/RacePaper.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: race_paper.proto +// source: race/race_paper.proto package club.joylink.rtss.vo.race; @@ -6875,29 +6875,29 @@ public final class RacePaper { descriptor; static { java.lang.String[] descriptorData = { - "\n\020race_paper.proto\022\004race\032\030common/modify_" + - "info.proto\032\026race/race_season.proto\"\257\001\n\013R" + - "acePaperVO\022\n\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\014\n\004" + - "desc\030\003 \001(\t\022\021\n\tseason_id\030\005 \001(\003\022\023\n\013season_" + - "name\030\006 \001(\t\022)\n\013modify_info\030\010 \001(\0132\024.common" + - ".ModifyInfoVO\022%\n\005group\030\t \001(\0162\026.race.Race" + - "Season.Group\"\320\001\n\021RacePaperDetailVO\022\n\n\002id" + - "\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\014\n\004desc\030\003 \001(\t\022*\n\tmo" + - "dule_vo\030\004 \001(\0132\027.race.RacePaperModuleVO\022\021" + - "\n\tseason_id\030\005 \001(\003\022\023\n\013season_name\030\006 \001(\t\022\024" + - "\n\014support_copy\030\007 \001(\010\022)\n\013modify_info\030\010 \001(" + - "\0132\024.common.ModifyInfoVO\"B\n\021RacePaperCrea" + - "teVO\022\014\n\004name\030\001 \001(\t\022\014\n\004desc\030\002 \001(\t\022\021\n\tseas" + - "on_id\030\003 \001(\003\"\275\002\n\021RacePaperModuleVO\0224\n\007mod" + - "ules\030\001 \003(\0132#.race.RacePaperModuleVO.Pape" + - "rModule\032\232\001\n\013PaperModule\022\023\n\013module_name\030\001" + - " \001(\t\022\020\n\010duration\030\002 \001(\005\022,\n\005group\030\003 \003(\0132\035." + - "race.RacePaperModuleVO.Group\022\034\n\024module_s" + - "core_rule_id\030\004 \001(\003\022\030\n\020custom_module_id\030\005" + - " \001(\005\032U\n\005Group\022\020\n\010task_ids\030\001 \003(\003\022,\n\005group" + - "\030\002 \003(\0132\035.race.RacePaperModuleVO.Group\022\014\n" + - "\004name\030\003 \001(\tB\033\n\031club.joylink.rtss.vo.race" + - "b\006proto3" + "\n\025race/race_paper.proto\022\004race\032\030common/mo" + + "dify_info.proto\032\026race/race_season.proto\"" + + "\257\001\n\013RacePaperVO\022\n\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(" + + "\t\022\014\n\004desc\030\003 \001(\t\022\021\n\tseason_id\030\005 \001(\003\022\023\n\013se" + + "ason_name\030\006 \001(\t\022)\n\013modify_info\030\010 \001(\0132\024.c" + + "ommon.ModifyInfoVO\022%\n\005group\030\t \001(\0162\026.race" + + ".RaceSeason.Group\"\320\001\n\021RacePaperDetailVO\022" + + "\n\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\014\n\004desc\030\003 \001(\t\022" + + "*\n\tmodule_vo\030\004 \001(\0132\027.race.RacePaperModul" + + "eVO\022\021\n\tseason_id\030\005 \001(\003\022\023\n\013season_name\030\006 " + + "\001(\t\022\024\n\014support_copy\030\007 \001(\010\022)\n\013modify_info" + + "\030\010 \001(\0132\024.common.ModifyInfoVO\"B\n\021RacePape" + + "rCreateVO\022\014\n\004name\030\001 \001(\t\022\014\n\004desc\030\002 \001(\t\022\021\n" + + "\tseason_id\030\003 \001(\003\"\275\002\n\021RacePaperModuleVO\0224" + + "\n\007modules\030\001 \003(\0132#.race.RacePaperModuleVO" + + ".PaperModule\032\232\001\n\013PaperModule\022\023\n\013module_n" + + "ame\030\001 \001(\t\022\020\n\010duration\030\002 \001(\005\022,\n\005group\030\003 \003" + + "(\0132\035.race.RacePaperModuleVO.Group\022\034\n\024mod" + + "ule_score_rule_id\030\004 \001(\003\022\030\n\020custom_module" + + "_id\030\005 \001(\005\032U\n\005Group\022\020\n\010task_ids\030\001 \003(\003\022,\n\005" + + "group\030\002 \003(\0132\035.race.RacePaperModuleVO.Gro" + + "up\022\014\n\004name\030\003 \001(\tB\033\n\031club.joylink.rtss.vo" + + ".raceb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/src/main/java/club/joylink/rtss/vo/race/RaceSceneOuterClass.java b/src/main/java/club/joylink/rtss/vo/race/RaceSceneOuterClass.java index 5f4d90c7b..a4fa94ea2 100644 --- a/src/main/java/club/joylink/rtss/vo/race/RaceSceneOuterClass.java +++ b/src/main/java/club/joylink/rtss/vo/race/RaceSceneOuterClass.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: race_scene.proto +// source: race/race_scene.proto package club.joylink.rtss.vo.race; @@ -5593,26 +5593,26 @@ public final class RaceSceneOuterClass { descriptor; static { java.lang.String[] descriptorData = { - "\n\020race_scene.proto\022\004race\032\030common/modify_" + - "info.proto\"\305\001\n\013RaceSceneVO\022\n\n\002id\030\001 \001(\003\022\014" + - "\n\004name\030\002 \001(\t\022\"\n\004type\030\003 \001(\0162\024.race.RaceSc" + - "ene.Type\022\022\n\nfunctionId\030\004 \001(\003\022\032\n\005scene\030\005 " + - "\001(\0132\013.race.Scene\022(\n\nmodifyInfo\030\006 \001(\0132\024.c" + - "ommon.ModifyInfoVO\022\r\n\005mapId\030\007 \001(\003\022\017\n\007map" + - "Name\030\010 \001(\t\"\234\001\n\017RaceSceneListVO\022\n\n\002id\030\001 \001" + - "(\003\022\014\n\004name\030\002 \001(\t\022\"\n\004type\030\003 \001(\0162\024.race.Ra" + - "ceScene.Type\022\016\n\006map_id\030\004 \001(\003\022\020\n\010map_name" + - "\030\005 \001(\t\022)\n\013modify_info\030\006 \001(\0132\024.common.Mod" + - "ifyInfoVO\"3\n\022RaceScenePublishVO\022\017\n\007dafit" + - "id\030\001 \001(\003\022\014\n\004name\030\003 \001(\t\"I\n\005Scene\022\013\n\003url\030\001" + - " \001(\t\0223\n\022storage_simulation\030\002 \001(\0132\027.race." + - "StorageSimulation\"\201\001\n\021StorageSimulation\022" + - "\025\n\rbg_scene_json\030\001 \001(\t\022\021\n\tstep_json\030\002 \001(" + - "\t\022\023\n\013member_json\030\003 \001(\t\022\022\n\nplayer_ids\030\004 \003" + - "(\t\022\031\n\021scoring_rule_json\030\005 \001(\t\"5\n\tRaceSce" + - "ne\"(\n\004Type\022\013\n\007Unknown\020\000\022\t\n\005Local\020\001\022\010\n\004Li" + - "nk\020\002B\033\n\031club.joylink.rtss.vo.raceb\006proto" + - "3" + "\n\025race/race_scene.proto\022\004race\032\030common/mo" + + "dify_info.proto\"\305\001\n\013RaceSceneVO\022\n\n\002id\030\001 " + + "\001(\003\022\014\n\004name\030\002 \001(\t\022\"\n\004type\030\003 \001(\0162\024.race.R" + + "aceScene.Type\022\022\n\nfunctionId\030\004 \001(\003\022\032\n\005sce" + + "ne\030\005 \001(\0132\013.race.Scene\022(\n\nmodifyInfo\030\006 \001(" + + "\0132\024.common.ModifyInfoVO\022\r\n\005mapId\030\007 \001(\003\022\017" + + "\n\007mapName\030\010 \001(\t\"\234\001\n\017RaceSceneListVO\022\n\n\002i" + + "d\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\"\n\004type\030\003 \001(\0162\024.ra" + + "ce.RaceScene.Type\022\016\n\006map_id\030\004 \001(\003\022\020\n\010map" + + "_name\030\005 \001(\t\022)\n\013modify_info\030\006 \001(\0132\024.commo" + + "n.ModifyInfoVO\"3\n\022RaceScenePublishVO\022\017\n\007" + + "dafitid\030\001 \001(\003\022\014\n\004name\030\003 \001(\t\"I\n\005Scene\022\013\n\003" + + "url\030\001 \001(\t\0223\n\022storage_simulation\030\002 \001(\0132\027." + + "race.StorageSimulation\"\201\001\n\021StorageSimula" + + "tion\022\025\n\rbg_scene_json\030\001 \001(\t\022\021\n\tstep_json" + + "\030\002 \001(\t\022\023\n\013member_json\030\003 \001(\t\022\022\n\nplayer_id" + + "s\030\004 \003(\t\022\031\n\021scoring_rule_json\030\005 \001(\t\"5\n\tRa" + + "ceScene\"(\n\004Type\022\013\n\007Unknown\020\000\022\t\n\005Local\020\001\022" + + "\010\n\004Link\020\002B\033\n\031club.joylink.rtss.vo.raceb\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/src/main/java/club/joylink/rtss/vo/race/RaceSeasonOuterClass.java b/src/main/java/club/joylink/rtss/vo/race/RaceSeasonOuterClass.java index e073a1fa4..d628ad484 100644 --- a/src/main/java/club/joylink/rtss/vo/race/RaceSeasonOuterClass.java +++ b/src/main/java/club/joylink/rtss/vo/race/RaceSeasonOuterClass.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: race_season.proto +// source: race/race_season.proto package club.joylink.rtss.vo.race; @@ -2495,16 +2495,16 @@ public final class RaceSeasonOuterClass { descriptor; static { java.lang.String[] descriptorData = { - "\n\021race_season.proto\022\004race\032\030common/modify" + - "_info.proto\"\210\001\n\014RaceSeasonVO\022\n\n\002id\030\001 \001(\003" + - "\022\014\n\004code\030\002 \001(\t\022%\n\005group\030\003 \001(\0162\026.race.Rac" + - "eSeason.Group\022\014\n\004term\030\004 \001(\t\022)\n\013modify_in" + - "fo\030\005 \001(\0132\024.common.ModifyInfoVO\"W\n\022RaceSe" + - "asonCreateVO\022\014\n\004code\030\001 \001(\t\022%\n\005group\030\002 \001(" + - "\0162\026.race.RaceSeason.Group\022\014\n\004term\030\003 \001(\t\"" + - "2\n\nRaceSeason\"$\n\005Group\022\013\n\007Unknown\020\000\022\006\n\002Z" + - "Z\020\001\022\006\n\002GZ\020\002B\033\n\031club.joylink.rtss.vo.race" + - "b\006proto3" + "\n\026race/race_season.proto\022\004race\032\030common/m" + + "odify_info.proto\"\210\001\n\014RaceSeasonVO\022\n\n\002id\030" + + "\001 \001(\003\022\014\n\004code\030\002 \001(\t\022%\n\005group\030\003 \001(\0162\026.rac" + + "e.RaceSeason.Group\022\014\n\004term\030\004 \001(\t\022)\n\013modi" + + "fy_info\030\005 \001(\0132\024.common.ModifyInfoVO\"W\n\022R" + + "aceSeasonCreateVO\022\014\n\004code\030\001 \001(\t\022%\n\005group" + + "\030\002 \001(\0162\026.race.RaceSeason.Group\022\014\n\004term\030\003" + + " \001(\t\"2\n\nRaceSeason\"$\n\005Group\022\013\n\007Unknown\020\000" + + "\022\006\n\002ZZ\020\001\022\006\n\002GZ\020\002B\033\n\031club.joylink.rtss.vo" + + ".raceb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/src/main/java/club/joylink/rtss/vo/race/RaceTaskFinishParamDTO.java b/src/main/java/club/joylink/rtss/vo/race/RaceTaskFinishParamDTO.java new file mode 100644 index 000000000..27721c12d --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/race/RaceTaskFinishParamDTO.java @@ -0,0 +1,20 @@ +package club.joylink.rtss.vo.race; + +import club.joylink.rtss.vo.paper.PaperTrainAnswerDetail; +import java.util.List; +import lombok.Data; + +/** + * 赛题训练任务完成接口的参数 + *

+ * 目前仅支持有本地场景的任务 + */ +@Data +public class RaceTaskFinishParamDTO { + + private String simulationId; + /** + * 实训评分参数(与完成实训接口的参数相同) + */ + private List scoreList; +}