1.对象转JSON串
WxTemplate temp = new WxTemplate();
String jsonString = JSONObject.fromObject(temp).toString();
2.JSON串转JSON对象
JSONObject json = JSONObject.parseObject(param);
3.mq中使用json串传输
mqParam.put(“woTypeIDList”, JSONObject.toJSONString((List) ecIDWoTypeIDMap.get(ecID)));
String woTypeIDListStr = (String) param.get(“woTypeIDList”);
List woTypeIDList= new ArrayList<>();
woTypeIDList = JSONObject.parseArray(woTypeIDListStr, String.class);
JSON开发中的传输作用
最新推荐文章于 2024-07-12 16:42:46 发布