原代码:
package com.bp.feign;
import com.alibaba.fastjson.JSONObject;
import com.bp.entity.dpt.UnifiedDataReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(name = "unifiedData",url = "${unifiedDataService.newUrl}")
public interface UnifiedDataGatewayClient {
@PostMapping(value = "/organization/organizations/search")
JSONObject getDptData(@RequestBody UnifiedDataReq unifiedDataReq, @RequestHeader("Authorization") String accessToken, @RequestHeader("Content-Type") String contentType);
}
修改后的代码:
@PostMapping(value = "/organization/organizations/search", consumes = "application/json", produces = "application/json")
package com.bp.feign;
import com.alibaba.fastjson.JSONObject;
import com.bp.entity.dpt.UnifiedDataReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(name = "unifiedData",url = "${unifiedDataService.newUrl}")
public interface UnifiedDataGatewayClient {
@PostMapping(value = "/organization/organizations/search", consumes = "application/json", produces = "application/json")
JSONObject getDptData(@RequestBody UnifiedDataReq unifiedDataReq, @RequestHeader("Authorization") String accessToken, @RequestHeader("Content-Type") String contentType);
}
看了半天csdn没有解决方案,最后在别处看到的:借鉴地址