对JSON的key做处理;
需要把Key解析出来,拼起来做参数使用
解析后如下:data_是我自己加的,后面的按key的层级,进行拼接
1.value是单层的
data_brand,
data_category,
data_ip,......
2.value是多层的
data_unresolvedData_macAddress,
data_unresolvedData_system_systemBit
JSON如下:
{
"brand": "server",
"category": "server",
"iP": "127.0.0.1",
"isSave": "true",
"isSaveRelation": "false",
"localPort": "",
"name": "test-app",
"portID": "",
"relations": {},
"type": "server",
"unresolvedData": {
"macAddress": "1234567",
"system": {
"systemBit": "123",
"systemType": "123",
"UUID": "",
"version": "123"
},
"ip": "127.0.0.1",
"hardDisk": {
"totalSize": "1GB",
"usedSize": "1GB",
"useableSize": "1GB"
},
"cpu": {
"model": "qwertyp",
"threadNum": "421",
"cpuNum": "22",
"totalCoreNum": "412",
"coreNum": "22"
},
"subType": "test",
"RAM": {
"totalSlot": "",
"maxCapacity": "1GB",
"maximumCapacity": ""
}
}
}