@FeignClient(name = "pms-rms",configuration = IFileUploadClient.MultipartSupportConfig.class)
public interface IFileUploadClient {
@RequestMapping("/module/fileManage/fileManageFileUploadInfoDomainList")
@ResponseBody
public List<FileManageFileUploadInfoDomain> selectList(@RequestBody FileManageFileUploadInfoDomain flFileupload);
@RequestMapping(method = RequestMethod.POST, value = "/module/fileManage/upload",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ResponseBody
public AjaxResult uploadFile(@RequestPart(value = "file") MultipartFile file, @RequestParam MultipartHttpServletRequest request);
@Configuration
class MultipartSupportConfig {
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
}
}
package com.hq.cloud.client.business;
import com.hq.cloud.base.Result;
import com.hq.cloud.bean.trade.create.ApiTradePreCreateModel;
import com.hq.cloud.bean.trade.jsapi.ApiJsApiModel;
import com.hq.cloud.bean.trade.query.ApiTradePollingModel;
import com.hq.cloud.bean.trade.query.ApiTradeQueryRefundModel;
import com.hq.cloud.bean.trade.refund.ApiTradeRefundModel;
import com.hq.cloud.client.hystrix.AppPayApiFallback;
import com.hq.cloud.dict.NoticeActEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@FeignClient(value = "business-service-pay", contextId = "IAppPayApiService", fallbackFactory = AppPayApiFallback.class)
@RequestMapping("/pay")
public interface IAppPayApiService {
@PostMapping("/tradePreCreate")
Result tradePreCreate(@RequestBody ApiTradePreCreateModel preCreateModel);
@PostMapping("/createJsApiOrder")
Result createJsApiOrder(ApiJsApiModel apiRequest);
@PostMapping("/pollingStatus")
Result pollingStatus(@RequestBody ApiTradePollingModel apiRequest);
@PostMapping("/tradeRefund")
Result tradeRefund(@RequestBody ApiTradeRefundModel apiRequest);
@PostMapping("/queryRefund")
Result queryRefund(@RequestBody ApiTradeQueryRefundModel apiRequest);
@PostMapping(value = "/upload/weiXinCertificate",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Result weiXinCertificate(@RequestPart("file") MultipartFile file, @RequestParam("appInfoId") Long appInfoId);
@GetMapping(value = "/callback/aliPay/notify/{noticeAct}", produces = "text/html")
String aliTradeNotice(@PathVariable("noticeAct") NoticeActEnum noticeAct, @RequestParam String payload);
@GetMapping(value = "/callback/weiXin/notify/{noticeAct}", produces = "text/html")
String weiXinTradeNotice(@PathVariable("noticeAct") NoticeActEnum noticeAct, @RequestParam String payload);
}