package com.hz.his.feign.service.phis; import com.hx.resultTool.Result; import com.hz.his.dto.file.FileDownDto; import feign.Response; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.io.File; /** * 这里这个name 需è¦å¡«å†™ 请求的æœåŠ¡æ供者的注册到nacos Server上é¢çš„æœåŠ¡å,path 是请求接å£å‰ç¼€ */ @FeignClient(name="phis-provider",path = "/p-his-data",contextId = "cos-down") public interface SFileService { /** *ä¸Šä¼ å›¾ç‰‡ï¼ˆè½¬åŒ–å®žä½“FileUpdateDto) * @param file 文件 * @param folderCode å˜å‚¨æ–‡ä»¶å¤¹,比如商å“è½®æ’图:/goods/banner * @param bucketName å˜å‚¨æ¡¶å称 * @return */ @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); /** *下载图片 * å¯ä»¥ä½¿ç”¨ FileDownUtil.downToFile()方法转化为文件 * @param cosDownDto 对象 * @return */ @PostMapping(value = "/cos/download-file") Response downloadFile(@RequestBody FileDownDto cosDownDto); }