forked from kidgrow-microservices-platform

luliqiang
2020-06-15 db2b00978eb478cc5f842cb4ba06c29276f6abca
kidgrow-business/kidgrow-filecenter/kidgrow-filecenter-api/src/main/java/com/kidgrow/filecenter/feign/FileService.java
@@ -1,11 +1,13 @@
package com.kidgrow.filecenter.feign;
import com.kidgrow.common.constant.ServiceNameConstants;
import com.kidgrow.filecenter.config.FeignMultipartConfig;
import com.kidgrow.filecenter.feign.fallback.FileServiceFallbackFactory;
import com.kidgrow.filecenter.model.FileInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
@@ -17,7 +19,7 @@
 * @CreateDate: Created in 2020/2/22 14:33 <br>
 * @Author: <a href="4345453@kidgrow.com">liuke</a>
 */
@FeignClient(name = ServiceNameConstants.FILE_CENTER_SERVER, fallbackFactory = FileServiceFallbackFactory.class, decode404 = true)
@FeignClient(name = ServiceNameConstants.FILE_CENTER_SERVER, configuration = FeignMultipartConfig.class,fallbackFactory = FileServiceFallbackFactory.class, decode404 = true)
public interface FileService {
    /**
     * 根据条件查询
@@ -25,4 +27,13 @@
     */
    @PostMapping(value = "/files-anon",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    FileInfo upload(@RequestPart("file") MultipartFile file);
    /**
     * 根据条件查询
     * @param file
     * @param imgType 文件类型:X光片/医院Logo[Xray/Logo]
     */
    @PostMapping(value = "/files-upload",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    FileInfo feignUpload(@RequestPart("file") MultipartFile file,@RequestParam("imgType") String imgType);
}