问题描述
我的FeignRequest遇到问题,我有一个500错误,说我的请求没有注释,但是它有注释,我在寻找解决方案上浪费了很多时间,但我似乎找不到。 。我不知道发生了什么事
我有一个控制器获取多部分文件:
@ApiOperation(value = "(For the plugin Illustrator) Upload files",produces = MediaType.APPLICATION_JSON_VALUE,httpMethod = "POST")
@RequestMapping(value = "/illustratorFileIntegration2",method = RequestMethod.POST)
public void uploadToShapes2(@RequestParam("file") MultipartFile uploadFile,@RequestParam("PID") String pid) throws IOException{
shapesClientService.uploadToShapes2(uploadFile,pid);
}
此控制器运行良好,可以从POSTMAN调用中获取所有信息(文件,PID等)
此控制器调用服务:
@Override
public void uploadToShapes2(MultipartFile file,S tring pid) throws IOException{
getShapesClientApi().uploadFileIllustrator2(file,pid);
}
再次运行良好,并且此服务通过调用客户端API将文件传输到另一个模块(出于安全原因,我无法告知):
@RequestMapping(method = RequestMethod.POST,value = "/illustrator/illustratorFileIntegration2?PID={PID}",produces = MediaType.MULTIPART_FORM_DATA_VALUE)
JsonResponse<Void> uploadFileIllustrator2(@RequestPart("file") MultipartFile file,@Param("PID") final String pid);
这是所有事情都出错了,因为此调用不起作用,但是如果我在邮递员中对我的其他模块进行了此特定调用,则此操作很好,所以这实际上是我的代码的这一部分不起作用
我的错误是:Request processing failed; nested exception is java.lang.IllegalStateException: Method uploadFileIllustrator2 not annotated with HTTP method type (ex. GET,POST)</
请随时说出您是否需要更多信息!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)