1.使用fastJson
2.controller层
@PostMapping("")
@ResponseBody
public BaseResponse jsonFunction(@RequestBody String jsonData){
BaseResponse baseResponse = new BaseResponse();
JSONObject data = JSONObject.parseObject(jsonData);
//处理基本类型
Integer articleId = data.getInteger("articleId");
String title = data.getString("title");
//处理List
List<ArticleVO> list = JSONArray.parseArray (jsonData, ArticleVO.class);
return baseResponse;
}
标签:baseResponse,BaseResponse,处理,spring,jsonData,json,data,String
From: https://www.cnblogs.com/lwx11111/p/17139496.html