实训单操 添加接口 manage/infos,不然与仿真/infos 接口冲突

This commit is contained in:
tiger_zhou 2023-01-04 16:45:33 +08:00
parent 258b8199e2
commit 8484acceb0
3 changed files with 24 additions and 2 deletions

View File

@ -52,11 +52,28 @@ public class TrainingV2PublishController {
} }
@PostMapping("/infos") /**
public List<PublishedTraining2InfoRspVo> findTrainingListInfos(@RequestBody PublishedTrainingListRspVo vo){ * 用户管理
* @param vo
* @return
*/
@PostMapping("/manage/infos")
public List<PublishedTraining2InfoRspVo> findTrainingListManageInfos(@RequestBody PublishedTrainingListRspVo vo){
return this.publishService.findTrainingInfo(vo); return this.publishService.findTrainingInfo(vo);
} }
/**
* 实训查询
* @param vo
* @return
*/
@PostMapping("/infos")
public List<PublishedTraining2InfoRspVo> findTrainingListInfos(@RequestBody PublishedTrainingListRspVo vo){
//只查询以上架
vo.setState(1);
return this.publishService.findTrainingInfo(vo);
}
/** /**
* 查所有的已发布场景实训的基础信息 * 查所有的已发布场景实训的基础信息
*/ */

View File

@ -223,6 +223,10 @@ public class Training2PublishService {
if(StringUtils.hasText(reqVO.getName())){ if(StringUtils.hasText(reqVO.getName())){
criteria.andNameLike(String.format("%%%s%%", reqVO.getName())); criteria.andNameLike(String.format("%%%s%%", reqVO.getName()));
} }
if(Objects.nonNull(reqVO.getState())){
criteria.andStateEqualTo(reqVO.getState());
}
if(!CollectionUtils.isEmpty(reqVO.getLabels())){ if(!CollectionUtils.isEmpty(reqVO.getLabels())){
StringBuilder sqlBuilder = new StringBuilder("("); StringBuilder sqlBuilder = new StringBuilder("(");
List<String> labels = reqVO.getLabels().stream().filter(StringUtils::hasText).distinct().collect(Collectors.toList()); List<String> labels = reqVO.getLabels().stream().filter(StringUtils::hasText).distinct().collect(Collectors.toList());

View File

@ -19,4 +19,5 @@ public class PublishedTrainingListRspVo {
private Training2TypeEnum type; private Training2TypeEnum type;
private String name; private String name;
private List<String> labels; private List<String> labels;
private Integer state;
} }