feat(UI测试): 增加文件上传限制
--story=1013573 --user=郭雨琦 https://www.tapd.cn/55049933/prong/stories/view/1155049933001013573
This commit is contained in:
parent
7b4bfb0756
commit
fe312b4aa6
|
@ -134,4 +134,10 @@ public class FileMetadataController {
|
|||
return fileMetadataService.exists(fileIds);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/exist")
|
||||
@RequiresPermissions("PROJECT_FILE:READ")
|
||||
public boolean existByName(@RequestBody FileMetadataWithBLOBs request) {
|
||||
return fileMetadataService.existByName(request);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -846,4 +846,11 @@ public class FileMetadataService {
|
|||
fileMetadataMapper.deleteByExample(example);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean existByName(FileMetadataWithBLOBs request) {
|
||||
FileMetadataExample example = new FileMetadataExample();
|
||||
example.createCriteria().andProjectIdEqualTo(request.getProjectId()).andNameEqualTo(request.getName()).andTypeEqualTo(request.getType());
|
||||
List<FileMetadata> fileMetadata = fileMetadataMapper.selectByExample(example);
|
||||
return CollectionUtils.isNotEmpty(fileMetadata);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue