| | |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import com.hz.his.dto.file.FileDownDto; |
| | | import com.hz.his.dto.file.FileSignVo; |
| | | import feign.Response; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.http.MediaType; |
| | |
| | | @RequestMapping(value = "/cos/upload-multipart",consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | Result upload(@RequestPart("file") MultipartFile file, @RequestParam("folderCode") String folderCode, @RequestParam("bucketName")String bucketName); |
| | | |
| | | |
| | | /** |
| | | *上传图片(转化实体FileUpdateDto) |
| | | * @param file 文件 |
| | |
| | | * @param bucketName 存储桶名称 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/cos/upload-file") |
| | | Result upload(@RequestParam("file") File file, @RequestParam("folderCode") String folderCode, @RequestParam("bucketName")String bucketName); |
| | | @RequestMapping(value = "/cos/upload-multipart/name",consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | Result upload(@RequestPart("file") MultipartFile file, @RequestParam("folderCode") String folderCode, @RequestParam("bucketName")String bucketName,@RequestParam("fileName")String fileName); |
| | | |
| | | |
| | | /** |
| | | *下载图片 |
| | | * 可以使用 FileDownUtil.downToFile()方法转化为文件 |
| | |
| | | @PostMapping(value = "/cos/download-file") |
| | | Response downloadFile(@RequestBody FileDownDto cosDownDto); |
| | | |
| | | /** |
| | | *生成签名访问URL |
| | | * @param fileSignVo 对象 |
| | | * @return 使用FileSignReturnVo转化 |
| | | */ |
| | | @PostMapping(value = "/cos/signUrl") |
| | | Response downloadFile(@RequestBody FileSignVo fileSignVo); |
| | | |
| | | } |