找到API地址

  1. 打开 https://console.apipost.cn/
  2. 进入到自己空间下面
  3. https://console-api.apipost.cn/api/apis/get_target_ids 这个里面返回得是所有API得基本数据
  4. https://console-api.apipost.cn/api/apis/get_multi_api_details 这个里面返回API得详细数据

    JSON剖析

    1. {
    2. "code": 10000,
    3. "msg": "success",
    4. "data": {
    5. "list": [
    6. {
    7. "target_id": "00cd2277-4c1a-45c2-8d76-91adf7711f1b",
    8. "target_type": "api",
    9. "name": "审批方案",
    10. "sort": 14,
    11. "version": 1,
    12. "mark": "developing",
    13. "status": 1,
    14. "method": "POST",
    15. "is_example": 0,
    16. "is_locked": -1,
    17. "url": "/proTarget/examineTarget",
    18. "parent_id": "8507eee0-e290-4ada-b594-c7c59ca99f7e"
    19. }
    20. ]
    21. }
    22. }
    1. {
    2. "code": 10000,
    3. "msg": "success",
    4. "data": [
    5. {
    6. "target_id": "615bc04e-455d-46d3-bda0-2fc16007fc93",
    7. "parent_id": "0",
    8. "project_id": "c311039f-bc5f-495e-f1bb-39a5dcaf6ffe",
    9. "mark": "developing",
    10. "target_type": "api",
    11. "example_type": "0",
    12. "name": "新 保费概况",
    13. "method": "GET",
    14. "sort": 3,
    15. "type_sort": 1,
    16. "update_day": 1657900800,
    17. "update_dtime": 1657905689,
    18. "bak_id": 0,
    19. "version": 2,
    20. "is_publish": 0,
    21. "publisher": 0,
    22. "publish_dtime": 0,
    23. "hash": "",
    24. "is_changed": -1,
    25. "create_dtime": 1657897180,
    26. "is_doc": 0,
    27. "is_example": 0,
    28. "mock_url": "",
    29. "mock": "",
    30. "url": "/business/NewQueryPremiums",
    31. "request": {
    32. "url": "/business/NewQueryPremiums",
    33. "description": "",
    34. "auth": {
    35. "type": "noauth",
    36. "kv": {
    37. "key": "",
    38. "value": ""
    39. },
    40. "bearer": {
    41. "key": ""
    42. },
    43. "basic": {
    44. "username": "",
    45. "password": ""
    46. }
    47. },
    48. "body": {
    49. "mode": "form-data",
    50. "parameter": [
    51. {
    52. "is_checked": 1,
    53. "type": "Text",
    54. "key": "comcode",
    55. "value": "00",
    56. "not_null": 1,
    57. "description": "机构",
    58. "field_type": "Text",
    59. "__DATAKEY__": "236efd04-485b-4afa-b255-4cca8f94868f"
    60. }
    61. ],
    62. "raw": "",
    63. "raw_para": []
    64. },
    65. "event": {
    66. "pre_script": "",
    67. "test": ""
    68. },
    69. "header": {
    70. "parameter": []
    71. },
    72. "query": {
    73. "parameter": []
    74. },
    75. "cookie": {
    76. "parameter": []
    77. },
    78. "resful": {
    79. "parameter": []
    80. }
    81. },
    82. "response": {
    83. "success": {
    84. "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}",
    85. "parameter": [
    86. {
    87. "key": "code",
    88. "value": "0000",
    89. "description": "状态 0000成功 9999失败",
    90. "not_null": 1,
    91. "field_type": "String",
    92. "type": "Text",
    93. "is_checked": 1,
    94. "__DATAKEY__": "c4c10021-6199-49dc-89da-6c2ee5027ada"
    95. }
    96. ]
    97. },
    98. "error": {
    99. "raw": "",
    100. "parameter": []
    101. }
    102. },
    103. "is_locked": -1
    104. }
    105. ]
    106. }

    实现思路

  5. JSON转VO http://www.ab173.com/json/json2javapojo.php

  6. 解析JSON
  7. 业务处理
  8. 生成java代码

    关键代码