微服务调用form-data 流文件异常

No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.cloud.module.smartkey.dto.UploadParam["uploadFile"]->org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile["inputStream"]->java.io.FileInputStream["fd"])

 

  @PostMapping(value = "/ObjectOper/upload/v2")
    FileReturn upload(UploadParam param);

更改成

    @PostMapping(value = "/ObjectOper/upload/v2", consumes = {"multipart/form-data"})
    FileReturn upload(UploadParam param);

 

posted @ 2024-04-28 15:49  八英里  阅读(125)  评论(0编辑  收藏  举报