diff --git a/src/main/java/club/joylink/rtss/controller/training2/TrainingV2PublishController.java b/src/main/java/club/joylink/rtss/controller/training2/TrainingV2PublishController.java index f3740098a..29e6c32fd 100644 --- a/src/main/java/club/joylink/rtss/controller/training2/TrainingV2PublishController.java +++ b/src/main/java/club/joylink/rtss/controller/training2/TrainingV2PublishController.java @@ -52,11 +52,28 @@ public class TrainingV2PublishController { } - @PostMapping("/infos") - public List findTrainingListInfos(@RequestBody PublishedTrainingListRspVo vo){ + /** + * 用户管理 + * @param vo + * @return + */ + @PostMapping("/manage/infos") + public List findTrainingListManageInfos(@RequestBody PublishedTrainingListRspVo vo){ + return this.publishService.findTrainingInfo(vo); } + /** + * 实训查询 + * @param vo + * @return + */ + @PostMapping("/infos") + public List findTrainingListInfos(@RequestBody PublishedTrainingListRspVo vo){ + //只查询以上架 + vo.setState(1); + return this.publishService.findTrainingInfo(vo); + } /** * 查所有的已发布场景实训的基础信息 */ diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java index 1de7417ad..61a94eb58 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java @@ -223,6 +223,10 @@ public class Training2PublishService { if(StringUtils.hasText(reqVO.getName())){ criteria.andNameLike(String.format("%%%s%%", reqVO.getName())); } + if(Objects.nonNull(reqVO.getState())){ + criteria.andStateEqualTo(reqVO.getState()); + } + if(!CollectionUtils.isEmpty(reqVO.getLabels())){ StringBuilder sqlBuilder = new StringBuilder("("); List labels = reqVO.getLabels().stream().filter(StringUtils::hasText).distinct().collect(Collectors.toList()); diff --git a/src/main/java/club/joylink/rtss/vo/training2/publish/PublishedTrainingListRspVo.java b/src/main/java/club/joylink/rtss/vo/training2/publish/PublishedTrainingListRspVo.java index 79fc05961..76553c712 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/publish/PublishedTrainingListRspVo.java +++ b/src/main/java/club/joylink/rtss/vo/training2/publish/PublishedTrainingListRspVo.java @@ -19,4 +19,5 @@ public class PublishedTrainingListRspVo { private Training2TypeEnum type; private String name; private List labels; + private Integer state; }