找到API地址
- 打开 https://console.apipost.cn/
- 进入到自己空间下面
- https://console-api.apipost.cn/api/apis/get_target_ids 这个里面返回得是所有API得基本数据
https://console-api.apipost.cn/api/apis/get_multi_api_details 这个里面返回API得详细数据
JSON剖析
{
"code": 10000,
"msg": "success",
"data": {
"list": [
{
"target_id": "00cd2277-4c1a-45c2-8d76-91adf7711f1b",
"target_type": "api",
"name": "审批方案",
"sort": 14,
"version": 1,
"mark": "developing",
"status": 1,
"method": "POST",
"is_example": 0,
"is_locked": -1,
"url": "/proTarget/examineTarget",
"parent_id": "8507eee0-e290-4ada-b594-c7c59ca99f7e"
}
]
}
}
{
"code": 10000,
"msg": "success",
"data": [
{
"target_id": "615bc04e-455d-46d3-bda0-2fc16007fc93",
"parent_id": "0",
"project_id": "c311039f-bc5f-495e-f1bb-39a5dcaf6ffe",
"mark": "developing",
"target_type": "api",
"example_type": "0",
"name": "新 保费概况",
"method": "GET",
"sort": 3,
"type_sort": 1,
"update_day": 1657900800,
"update_dtime": 1657905689,
"bak_id": 0,
"version": 2,
"is_publish": 0,
"publisher": 0,
"publish_dtime": 0,
"hash": "",
"is_changed": -1,
"create_dtime": 1657897180,
"is_doc": 0,
"is_example": 0,
"mock_url": "",
"mock": "",
"url": "/business/NewQueryPremiums",
"request": {
"url": "/business/NewQueryPremiums",
"description": "",
"auth": {
"type": "noauth",
"kv": {
"key": "",
"value": ""
},
"bearer": {
"key": ""
},
"basic": {
"username": "",
"password": ""
}
},
"body": {
"mode": "form-data",
"parameter": [
{
"is_checked": 1,
"type": "Text",
"key": "comcode",
"value": "00",
"not_null": 1,
"description": "机构",
"field_type": "Text",
"__DATAKEY__": "236efd04-485b-4afa-b255-4cca8f94868f"
}
],
"raw": "",
"raw_para": []
},
"event": {
"pre_script": "",
"test": ""
},
"header": {
"parameter": []
},
"query": {
"parameter": []
},
"cookie": {
"parameter": []
},
"resful": {
"parameter": []
}
},
"response": {
"success": {
"raw": "{\r\n\t\"code\": \"0000\",\r\n\t\"data\": {\r\n\t\t\"nxpreium\": 1348917,\r\n\t\t\"hbpreium\": 0.015961560624031459899039775939185024801,\r\n\t\t\"E1\": [\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"团体意外伤害保险\",\r\n\t\t\t\t\"premium\": 64870.32\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"团体意外伤害保险\",\r\n\t\t\t\t\"premium\": 35635.74\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"驾乘人员意外伤害保险\",\r\n\t\t\t\t\"premium\": 21047.02\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"驾乘人员意外伤害保险\",\r\n\t\t\t\t\"premium\": 14796.09\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"团体建筑施工人员意外伤害保险(A款)\",\r\n\t\t\t\t\"premium\": 11892.99\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"团体交通意外伤害保险\",\r\n\t\t\t\t\"premium\": 10684.54\r\n\t\t\t}\r\n\t\t],\r\n\t\t\"yjxpreium\": 86989.88,\r\n\t\t\"cxqtpreium\": 407583.54,\r\n\t\t\"tqpremium\": 1005945.39,\r\n\t\t\"tbzbpremium\": 1.35108978430727735627875385959072788236,\r\n\t\t\"statdate\": \"2022-07-15\",\r\n\t\t\"hlwpreium\": 258223.18,\r\n\t\t\"cxzbpreium\": 0.3044354417338025466355209509775053268766,\r\n\t\t\"qdlastdaypreium\": 2327910.84,\r\n\t\t\"ccxpreium\": 209150.55,\r\n\t\t\"cccfldzbpreium\": 0.0884332104575110449364555884024861814434,\r\n\t\t\"yyhczbpreium\": 0.0274252528261740627393628287365253701161,\r\n\t\t\"cxqtzbpreium\": 0.5660799946667444433102017262248258879558,\r\n\t\t\"gqpreium\": 457789.51,\r\n\t\t\"cxpreium\": 720010.5,\r\n\t\t\"cccfldpreium\": 11014.93,\r\n\t\t\"D1\": [\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"种植保险\",\r\n\t\t\t\t\"premium\": 953357.85\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"种植保险\",\r\n\t\t\t\t\"premium\": 1317717\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"养殖保险\",\r\n\t\t\t\t\"premium\": 31200\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"养殖保险\",\r\n\t\t\t\t\"premium\": 102600\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"森林综合保险\",\r\n\t\t\t\t\"premium\": 0\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"森林综合保险\",\r\n\t\t\t\t\"premium\": 0\r\n\t\t\t}\r\n\t\t],\r\n\t\t\"B1\": [\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"建筑工程一切险\",\r\n\t\t\t\t\"premium\": 117862.26\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"雇主责任保险\",\r\n\t\t\t\t\"premium\": 58041.71\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"雇主责任保险(灵活用工版)\",\r\n\t\t\t\t\"premium\": 38688.84\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"雇主责任保险\",\r\n\t\t\t\t\"premium\": 76646.04\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"道路客运承运人责任保险\",\r\n\t\t\t\t\"premium\": 37742.07\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"riskname\": \"雇主责任保险(灵活用工版)\",\r\n\t\t\t\t\"premium\": 31025.57\r\n\t\t\t}\r\n\t\t],\r\n\t\t\"sjczbpreium\": 0.4064947525070814939504354450386487419281,\r\n\t\t\"yjxzbpreium\": 0.0367811338087020612553822079858822490566,\r\n\t\t\"sjcpreium\": 292680.49,\r\n\t\t\"nxzbpreiumc\": 0.5703502139999843471726412526341262426234,\r\n\t\t\"qdpreium\": 2365067.93,\r\n\t\t\"yyhcpreium\": 19746.47\r\n\t},\r\n\t\"message\": \"查询成功\"\r\n}",
"parameter": [
{
"key": "code",
"value": "0000",
"description": "状态 0000成功 9999失败",
"not_null": 1,
"field_type": "String",
"type": "Text",
"is_checked": 1,
"__DATAKEY__": "c4c10021-6199-49dc-89da-6c2ee5027ada"
}
]
},
"error": {
"raw": "",
"parameter": []
}
},
"is_locked": -1
}
]
}
实现思路
- 解析JSON
- 业务处理
- 生成java代码
关键代码