Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json 通过Syncfusion Datamanager为多部分/混合post构建Spring控制器_Json_Spring_Spring Boot_Multipart_Syncfusion - Fatal编程技术网

Json 通过Syncfusion Datamanager为多部分/混合post构建Spring控制器

Json 通过Syncfusion Datamanager为多部分/混合post构建Spring控制器,json,spring,spring-boot,multipart,syncfusion,Json,Spring,Spring Boot,Multipart,Syncfusion,您好,我目前正在尝试构建一个与Syncfusion的Datamanager相匹配的spring boot后端(据我所知,他们的后端构建文档纯粹是针对.NET的)。我已经设法使get功能正常工作,因此我的数据类型映射是正确的,但发布会导致一些问题。具体地说,DataManager似乎发布了一个多部分/混合文件,其中包括我试图持久化的JSON对象以及某种批处理文件(我不关心)。因为我不能修改datamanager,所以我需要在spring中找到一种方法来完全提取JSON。我相信这确实很简单,但我对这

您好,我目前正在尝试构建一个与Syncfusion的Datamanager相匹配的spring boot后端(据我所知,他们的后端构建文档纯粹是针对.NET的)。我已经设法使get功能正常工作,因此我的数据类型映射是正确的,但发布会导致一些问题。具体地说,DataManager似乎发布了一个多部分/混合文件,其中包括我试图持久化的JSON对象以及某种批处理文件(我不关心)。因为我不能修改datamanager,所以我需要在spring中找到一种方法来完全提取JSON。我相信这确实很简单,但我对这方面还相当陌生,找不到任何其他以前问过的与我目前情况相符的问题。 这是Chrome开发者工具中列出的请求详细信息的副本。

概述

***请求URL:$batch

申请方式:邮寄

状态代码:415

远程地址:[::1]:8082

推荐人策略:降级时无推荐人

响应标题

访问控制允许标头:授权、内容类型

访问控制允许方法:POST、PUT、GET、OPTIONS、DELETE

访问控制允许来源:*

访问控制最大年龄:3600

内容类型:application/json

日期:2019年11月22日星期五14:38:39 GMT

传输编码:分块

变化:起源

更改:访问控制请求方法

更改:访问控制请求标头

请求标题

接受:application/json,text/javascript,/;q=0.01,应用程序/json

接受编码:gzip,deflate,br

接受语言:en-US,en;q=0.9

连接:保持活力

内容长度:358

内容类型:多部分/混合;边界=批次_dddabc0b-930c-47fc-b7e5-934999f0adc9

主机:localhost:8082

来源:

推荐人:

秒取数模式:cors

Sec获取站点:同一站点

用户代理:Mozilla/5.0(Windows NT 10.0;Win64;x64)AppleWebKit/537.36(KHTML,类似Gecko)Chrome/78.0.3904.108 Safari/537.36

请求有效负载

--批次号dddabc0b-930c-47fc-b7e5-934999f0adc9

内容类型:应用程序/http;msgtype=请求

POST/api/null HTTP/1.1

内容类型:application/json;字符集=utf-8

主机:localhost:4200

{“主题”:“m”,“Id”:4,“开始时间”:“2019-11-21T06:30:00.000Z”,“结束时间”:“2019-11-21T07:00:00.000Z”,“IsAllDay”:false}

--批次号dddabc0b-930c-47fc-b7e5-934999f0adc9--***

这是我的控制器当前的副本。(基本上是为了接受常规应用程序/json帖子而构建的)

import java.util.List;
导入javax.servlet.http.HttpServletResponse;
导入org.springframework.beans.factory.annotation.Autowired;
导入org.springframework.web.bind.annotation.CrossOrigin;
导入org.springframework.web.bind.annotation.GetMapping;
导入org.springframework.web.bind.annotation.PostMapping;
导入org.springframework.web.bind.annotation.RequestBody;
导入org.springframework.web.bind.annotation.RequestMapping;
导入org.springframework.web.bind.annotation.RestController;
导入com.quietmodebackend.models.Appointment;
导入com.quietmodebackend.repos.ScheduleRepository;
@交叉起源
@RestController
@请求映射(“/schedule”)
公共类调度控制器{
@自动连线
计划库myRepo;
@GetMapping
公共列表GetAppointment(HttpServletResponse){
答复:setStatus(200);
返回myRepo.findAll();
}
@邮戳(“/$batch”)
公共预约后预约(HttpServletResponse,@RequestBody预约){
返回myRepo.save(预约);
}
}
任何帮助都将不胜感激

Dear Customer,

Syncfusion Greetings

Scheduler CRUD actions support is not provided for WebApiAdaptor which could be the cause and for the same we already logged the below feature request.

https://www.syncfusion.com/feedback/2373/batch-handler-support-for-asp-net-core-while-using-webapi-adaptor

Kindly use UrlAdaptor like below sample.

Sample: https://stackblitz.com/edit/angular-ysiqa8-9s3lef?file=app.component.ts
Service: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ej2-schedule-crud-1800404263 

 private dataManger: DataManager = new DataManager({
    url: "http://localhost:25255/api/Batch", 
    crossDomain: true, 
    adaptor: new UrlAdaptor 
  });

Note: Keep the Service project in runnable state.

Regards,
M.Vinitha devi
Dear Customer,

Syncfusion Greetings

Scheduler CRUD actions support is not provided for WebApiAdaptor which could be the cause and for the same we already logged the below feature request.

https://www.syncfusion.com/feedback/2373/batch-handler-support-for-asp-net-core-while-using-webapi-adaptor

Kindly use UrlAdaptor like below sample.

Sample: https://stackblitz.com/edit/angular-ysiqa8-9s3lef?file=app.component.ts
Service: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ej2-schedule-crud-1800404263 

 private dataManger: DataManager = new DataManager({
    url: "http://localhost:25255/api/Batch", 
    crossDomain: true, 
    adaptor: new UrlAdaptor 
  });

Note: Keep the Service project in runnable state.

Regards,
M.Vinitha devi