webapi 获取url接口优化调整
This commit is contained in:
parent
d8614af1ea
commit
b66893aa84
@ -101,10 +101,7 @@ public class WebFileController {
|
|||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@PostMapping("/v1/file/getUrl")
|
@PostMapping("/v1/file/getUrl")
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
public CommonResponse<List<FindFileUrlVo>> getUrl(@Valid @RequestParam List<String> fileKey) {
|
public CommonResponse<List<FindFileUrlVo>> getUrl(@Valid @RequestBody FindFileUrlDto dto) {
|
||||||
FindFileUrlDto dto = FindFileUrlDto.builder()
|
|
||||||
.fileKey(fileKey)
|
|
||||||
.build();
|
|
||||||
List<FindFileUrlResponse> response = fileService.findFileUrl(dto);
|
List<FindFileUrlResponse> response = fileService.findFileUrl(dto);
|
||||||
return CommonResponse.success(BeanConverter.convert(response, FindFileUrlVo.class));
|
return CommonResponse.success(BeanConverter.convert(response, FindFileUrlVo.class));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,6 +243,10 @@ public class FileServiceImpl implements FileService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
List<File> fileList = fileDao.getByUrlMd5s(urlMd5List);
|
List<File> fileList = fileDao.getByUrlMd5s(urlMd5List);
|
||||||
|
//处理app端历史数据不在file表中的情况
|
||||||
|
if (urlMd5List.size() > fileList.size()) {
|
||||||
|
// TODO: 2022/12/7
|
||||||
|
}
|
||||||
if (CollectionUtil.isEmpty(fileList)) {
|
if (CollectionUtil.isEmpty(fileList)) {
|
||||||
log.warn("find file key is null,url = {}", Arrays.toString(dto.getUrl().toArray()));
|
log.warn("find file key is null,url = {}", Arrays.toString(dto.getUrl().toArray()));
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user