package cn.tongdun.robot.web;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature; import java.util.List; /**
* @author hello
* @date 2019-10-18 13:46
* @description
*/
public class Hello {
public static void main(String[] args) {
String str = "[\n" +
" {\n" +
" \"type\": \"SEND\",\n" +
" \"dataMapping\": {\n" +
" \"userid\": \"account\",\n" +
" \"ts\": \"ts\",\n" +
" \"sign\": \"sign\",\n" +
" \"mobile\": \"taskItem.mobile\",\n" +
" \"msgcontent\": \"taskItem.content\",\n" +
" \"time\": \"taskItem.scheduleTime\",\n" +
" \"URL\": \"http://1.1.1.1:8081/api/sms/send\",\n" +
" \"password\": \"password\"\n" +
" },\n" +
" \"maxSendCount\": \"1000\",\n" +
" \"tps\": \"50\",\n" +
" \"channelPattern\": \"JSON\",\n" +
" \"sendSeparate\": \"\",\n" +
" \"httpHeaderParams\": {\n" +
" \"Authorization\": \"authorization\"\n" +
" }\n" +
" },\n" +
" {\n" +
" \"type\": \"REPORT\",\n" +
" \"dataMapping\": {\n" +
" \"userid\": \"account\",\n" +
" \"ts\": \"ts\",\n" +
" \"sign\": \"sign\",\n" +
" \"password\": \"password\",\n" +
" \"URL\": \"http://1.1.1.1/api/v2/sms/query\"\n" +
" },\n" +
" \"tps\": \"10\",\n" +
" \"channelPattern\": \"JSON\"\n" +
" }\n" +
"]"; // Object list = JSON.parse(str, Feature.OrderedField); List<HelloBean> list = JSON.parseObject(str, new TypeReference<List<HelloBean>>() {}.getType(), Feature.OrderedField);
System.out.println(list);
}
}

  

package cn.tongdun.robot.web;

import com.alibaba.fastjson.JSONObject;

/**
* @author hello
* @date 2019-10-18 14:29
* @description
*/
public class HelloBean { /**
* type : REPORT
* dataMapping : {"userid":"account","ts":"ts","sign":"sign","password":"password","URL":"http://47.99.224.177:8081/api/v2/sms/query"}
* tps : 10
* channelPattern : JSON
*/ private String type;
private JSONObject dataMapping;
private String tps;
private String channelPattern; public String getType() {
return type;
} public void setType(String type) {
this.type = type;
} public JSONObject getDataMapping() {
return dataMapping;
} public void setDataMapping(JSONObject dataMapping) {
this.dataMapping = dataMapping;
} public String getTps() {
return tps;
} public void setTps(String tps) {
this.tps = tps;
} public String getChannelPattern() {
return channelPattern;
} public void setChannelPattern(String channelPattern) {
this.channelPattern = channelPattern;
}
}

  

最新文章

  1. Javascript中的valueOf与toString
  2. thinkphp5命名规范
  3. UVA 11076 - Add Again(组合)
  4. ubuntu安装Python环境以及科学计算环境
  5. 本地缺Android SDK版本20,Unable to resolve target &#39;android-20&#39;
  6. 跟开涛老师学shiro -- shiro简介
  7. 黄聪:wordpress如何添加自定义文章快速编辑按钮
  8. Android核心分析之十八Android电话系统之RIL-Java
  9. UnitTest
  10. 深入理解Python中的生成器
  11. 高清摄像头MIPI接口与ARM处理器的连接
  12. webuploader文件上传问题总结
  13. mybatis拦截器分页
  14. Bootstrap入门(二十)组件14:警告框
  15. iBatis一些非见用法(相当实用)
  16. rem ~~ 你懂了吗?
  17. Spring源码工程导入Eclsipse缺少两个jar文件
  18. [Swift]LeetCode349. 两个数组的交集 | Intersection of Two Arrays
  19. Appium日志乱码终结指北
  20. cocos2dx2.x&amp;3.x部分函数对照表

热门文章

  1. robot:当用例失败时执行关键字(发送短信)
  2. Spring Boot拦截器实现并和swagger集成后使用拦截器的配置问题
  3. Saltack 针对用户进行权限控制
  4. mac远程连接linux 服务器桌面by VNC
  5. 【转帖】从 Oracle 到 PostgreSQL ,某保险公司迁移实践 技术实践
  6. Apache Kafka + Spark Streaming Integration
  7. Educational Codeforces Round 71
  8. 【LEETCODE】50、数组分类,简单级别,题目:888,1013,896,485,448,697
  9. 小贴士--Python
  10. Helm命令帮助参数