0626 ljc 测试用例模块查询接口修改
This commit is contained in:
parent
37718e9fa3
commit
581076e14e
@ -84,4 +84,12 @@ public class TestCaseInfoController {
|
||||
return CommonResult.success(resp);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path="/findFileTypeList")
|
||||
public CommonResult<List<String>> findFileTypeList(){
|
||||
|
||||
List<String> respList = testCaseInfoService.findFileTypeList();
|
||||
|
||||
return CommonResult.success(respList);
|
||||
}
|
||||
}
|
||||
|
@ -31,4 +31,6 @@ public interface TestCaseInfoService extends IService<TestCaseInfo> {
|
||||
PageResult<TestCaseInfoResp> findPage(@Valid TestCaseInfoQueryReq query);
|
||||
|
||||
TestCaseInfoResp findById(String id);
|
||||
|
||||
List<String> findFileTypeList();
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -101,6 +102,22 @@ public class TestCaseInfoServiceImpl extends ServiceImpl<TestCaseInfoDao, TestCa
|
||||
return testCaseInfoResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findFileTypeList() {
|
||||
List<TestCaseInfo> testCaseInfos = testCaseInfoDao.selectList(new QueryWrapper<>());
|
||||
|
||||
if (ObjectUtils.isEmpty(testCaseInfos)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
//将文件类型取出并去重
|
||||
List<String> fileTypeList = testCaseInfos.stream().map(TestCaseInfo::getTestFileType).distinct().toList();
|
||||
|
||||
if (CollectionUtils.isEmpty(fileTypeList)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return fileTypeList;
|
||||
}
|
||||
|
||||
|
||||
private void setUserName(TestCaseInfoResp testCaseInfoResp) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user