接口 FileFeign
@FeignClient(name="${yst.service.system:yst-dms2-newsys}",
path="/api/v1/comm/file",
contextId="fileFeign",
primary=false)
public interface FileFeign
文件管理 Feign 接口
-
方法概要
修饰符和类型方法说明deleteArchive(UUID archiveId) 删除压缩包及其所有解压文件deleteFile(UUID id) 删除文件extParamUpload(org.springframework.web.multipart.MultipartFile file, String _child, Map<String, String> extParam) 上传文件extParamUploadArchive(org.springframework.web.multipart.MultipartFile file, Map<String, String> extParam) 上传并解压压缩包getArchiveFile(UUID fileId, Integer currentPage, Integer pageSize, String fileName) 获取压缩包内文件信息(支持分页)getArchiveFileDownloadUrl(UUID fileId) 获取压缩包内文件的下载URLgetDownloadUrls(List<String> ids) 批量获取文件下载URLgetFileDetail(UUID id) 获取文件记录详情getFileDetails(FileDetailListQueryVO queryVO) 批量获取文件记录详情previewFile(String id) 预览文件 注意:Feign不支持直接预览文件流,建议使用获取文件详情后通过URL预览previewImage(String id) 图片预览 注意:Feign不支持直接返回图片数据,建议使用获取文件详情后通过URL访问uploadArchive(org.springframework.web.multipart.MultipartFile file) 上传并解压压缩包uploadFile(org.springframework.web.multipart.MultipartFile file, String _child) 上传文件到OSS
-
方法详细资料
-
uploadFile
@PostMapping(value="/upload", consumes="multipart/form-data") ApiResult<FileUploadResultDto> uploadFile(@RequestPart("file") org.springframework.web.multipart.MultipartFile file, @RequestParam(value="_child",required=false) String _child) 上传文件到OSS- 参数:
file- 文件_child- 子目录(可选)- 返回:
- 上传结果
-
uploadArchive
@PostMapping(value="/archive/upload", consumes="multipart/form-data") ApiResult<ArchiveUploadResultDto> uploadArchive(@RequestParam("file") org.springframework.web.multipart.MultipartFile file) 上传并解压压缩包 -
extParamUpload
@PostMapping(value="/extParamUpload", consumes="multipart/form-data") ApiResult<FileUploadResultDto> extParamUpload(@RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam(value="_child",required=false) String _child, @RequestParam(required=false) Map<String, String> extParam) 上传文件 -
extParamUploadArchive
@PostMapping(value="/archive/extParamUpload", consumes="multipart/form-data") ApiResult<ArchiveUploadResultDto> extParamUploadArchive(@RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false) Map<String, String> extParam) 上传并解压压缩包 -
getArchiveFile
@GetMapping("/archive/file/{fileId}") ApiResult<ArchiveFileDto> getArchiveFile(@PathVariable("fileId") UUID fileId, @RequestParam(value="currentPage",required=false,defaultValue="1") Integer currentPage, @RequestParam(value="pageSize",required=false,defaultValue="20") Integer pageSize, @RequestParam(value="fileName",required=false) String fileName) 获取压缩包内文件信息(支持分页)- 参数:
fileId- 压缩包内文件IDcurrentPage- 当前页码,从1开始pageSize- 每页数量fileName- 文件名称筛选(模糊匹配)- 返回:
- 文件信息(含downloadUrl)
-
deleteArchive
@DeleteMapping("/archive/{archiveId}") ApiResult<Boolean> deleteArchive(@PathVariable("archiveId") UUID archiveId) 删除压缩包及其所有解压文件 -
getArchiveFileDownloadUrl
@GetMapping("/archive/file/{fileId}/download-url") ApiResult<String> getArchiveFileDownloadUrl(@PathVariable("fileId") UUID fileId) 获取压缩包内文件的下载URL- 参数:
fileId- 压缩包内文件ID- 返回:
- 下载URL
-
getDownloadUrls
@PostMapping("/download/batch-urls") ApiResult<Map<String,String>> getDownloadUrls(@RequestBody List<String> ids) 批量获取文件下载URL- 参数:
ids- 文件ID列表- 返回:
- Map,key为文件ID,value为对应的下载URL
-
previewFile
预览文件 注意:Feign不支持直接预览文件流,建议使用获取文件详情后通过URL预览- 参数:
id- 文件ID或文件标识符- 返回:
- 文件预览响应(需要在调用方处理)
-
previewImage
图片预览 注意:Feign不支持直接返回图片数据,建议使用获取文件详情后通过URL访问- 参数:
id- 文件ID或文件标识符- 返回:
- 图片数据(需要在调用方处理)
-
getFileDetail
@GetMapping("/detail/{id}") ApiResult<SysFileRecordDetailRespDTO> getFileDetail(@PathVariable("id") UUID id) 获取文件记录详情- 参数:
id- 文件ID- 返回:
- 文件记录详情
-
getFileDetails
@PostMapping("/detail/batch") ApiResult<List<SysFileRecordDetailRespDTO>> getFileDetails(@RequestBody FileDetailListQueryVO queryVO) 批量获取文件记录详情- 参数:
queryVO- 查询VO,包含文件ID列表- 返回:
- 文件记录详情列表
-
deleteFile
删除文件- 参数:
id- 文件ID- 返回:
- 是否删除成功
-