feignclient:
@FeignClient(value = "code-analysis")
public interface ICodeAnalysisService{
@PostMapping({"/cache"})
ResultVO<String> postResultCache(@RequestParam(value = "file",required = false) MultipartFile var1, @Valid @RequestPart("codeConfiguration") CodeConfigurationVO var2);
}
调用客户端:
codeAnalysisService.postResultCache(file,codeConfig)
例外是不存在codeConfiguration
答案 0 :(得分:0)
最终的解决方案是: 将api修改为:
ResultVO<String> postResultCacheInner(@RequestPart(value = "file",required = false) MultipartFile file,@RequestParam("codeConfiguration") String codeConfiguration);
调用客户端:
codeAnalysisService.postResultCache(file,codeConfig);
并且codeConfig是String类型,最后反序列化codeConfig。