webapi 获取url接口优化调整
This commit is contained in:
parent
d8614af1ea
commit
b66893aa84
@ -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));
|
||||
}
|
||||
|
||||
@ -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<>();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user