webapi 获取url接口优化调整

This commit is contained in:
tianliyong 2022-12-07 14:37:00 +08:00
parent d8614af1ea
commit b66893aa84
2 changed files with 5 additions and 4 deletions

View File

@ -101,10 +101,7 @@ public class WebFileController {
@SneakyThrows
@PostMapping("/v1/file/getUrl")
@CrossOrigin
public CommonResponse<List<FindFileUrlVo>> getUrl(@Valid @RequestParam List<String> fileKey) {
FindFileUrlDto dto = FindFileUrlDto.builder()
.fileKey(fileKey)
.build();
public CommonResponse<List<FindFileUrlVo>> getUrl(@Valid @RequestBody FindFileUrlDto dto) {
List<FindFileUrlResponse> response = fileService.findFileUrl(dto);
return CommonResponse.success(BeanConverter.convert(response, FindFileUrlVo.class));
}

View File

@ -243,6 +243,10 @@ public class FileServiceImpl implements FileService {
.collect(Collectors.toList());
List<File> fileList = fileDao.getByUrlMd5s(urlMd5List);
//处理app端历史数据不在file表中的情况
if (urlMd5List.size() > fileList.size()) {
// TODO: 2022/12/7
}
if (CollectionUtil.isEmpty(fileList)) {
log.warn("find file key is null,url = {}", Arrays.toString(dto.getUrl().toArray()));
return new ArrayList<>();