1.使用Feign
调用方:
import com.nick.movie.config.MultipartSupportConfig;
import com.nick.movie.utils.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
/**
* @version V1.0
* @ClassName:MovieService
* @author: hbj
* @CreateDate:2018/8/27 19:34
*/
@FeignClient(value = "file-server", path = "/attachment/file" ,configuration = MultipartSupportConfig.class)
public interface MicroCloudService {
@RequestMapping(value = "/upload/single", produces = {MediaType.APPLICATION_JSON_UTF8_V