package com.crm.manager.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created by max on 2021/3/24.
 */
@FeignClient(
        name = "FILE-SERVICE",
        path = "/common"
)
public interface FIleFeignService {

    @PostMapping(
            value = "/base/upload/{middlePath}",
            consumes = MediaType.MULTIPART_FORM_DATA_VALUE
    )
    String commonUpload(@RequestPart("file") MultipartFile file,
                        @PathVariable("middlePath") String middlePath) throws Exception;
}