feat(UI测试):  增加文件上传限制

--story=1013573 --user=郭雨琦
https://www.tapd.cn/55049933/prong/stories/view/1155049933001013573
This commit is contained in:
guoyuqi 2023-11-28 12:18:04 +08:00 committed by 刘瑞斌
parent 7b4bfb0756
commit fe312b4aa6
2 changed files with 13 additions and 0 deletions

View File

@ -134,4 +134,10 @@ public class FileMetadataController {
return fileMetadataService.exists(fileIds); return fileMetadataService.exists(fileIds);
} }
@PostMapping(value = "/exist")
@RequiresPermissions("PROJECT_FILE:READ")
public boolean existByName(@RequestBody FileMetadataWithBLOBs request) {
return fileMetadataService.existByName(request);
}
} }

View File

@ -846,4 +846,11 @@ public class FileMetadataService {
fileMetadataMapper.deleteByExample(example); 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);
}
} }