租户费用模块.postman_collection.json 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {
  2. "info": {
  3. "_postman_id": "a0f8f4c6-3e22-4bd4-a3c8-billing-module",
  4. "name": "租户费用模块联调集合",
  5. "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  6. },
  7. "item": [
  8. {
  9. "name": "1. 创建方案",
  10. "request": {
  11. "method": "POST",
  12. "header": [{ "key": "Content-Type", "value": "application/json" }],
  13. "url": { "raw": "{{baseUrl}}/api/fee/plan/create", "host": ["{{baseUrl}}"], "path": ["api","fee","plan","create"] },
  14. "body": {
  15. "mode": "raw",
  16. "raw": "{\n \"planCode\": \"STANDARD\",\n \"planName\": \"标准方案\",\n \"version\": 1,\n \"remark\": \"postman初始化\"\n}"
  17. }
  18. }
  19. },
  20. {
  21. "name": "2. 保存计费项",
  22. "request": {
  23. "method": "POST",
  24. "header": [{ "key": "Content-Type", "value": "application/json" }],
  25. "url": { "raw": "{{baseUrl}}/api/fee/plan/item/save", "host": ["{{baseUrl}}"], "path": ["api","fee","plan","item","save"] },
  26. "body": {
  27. "mode": "raw",
  28. "raw": "{\n \"planCode\": \"STANDARD\",\n \"version\": 1,\n \"items\": [\n {\"itemCode\":\"FLOW_POSTPAID\",\"unit\":\"GB\",\"unitPrice\":0.2,\"enabled\":1},\n {\"itemCode\":\"CALL_OUT\",\"unit\":\"MIN\",\"unitPrice\":0.3,\"minChargeUnit\":1,\"enabled\":1},\n {\"itemCode\":\"CALL_IN\",\"unit\":\"MIN\",\"unitPrice\":0.2,\"minChargeUnit\":1,\"enabled\":1},\n {\"itemCode\":\"AI_CALL\",\"unit\":\"MIN\",\"unitPrice\":0.15,\"minChargeUnit\":1,\"enabled\":1},\n {\"itemCode\":\"SOP_TOKEN\",\"unit\":\"TOKEN\",\"unitPrice\":1,\"tokenUnit\":100000,\"enabled\":1},\n {\"itemCode\":\"AI_REPLY_TOKEN\",\"unit\":\"TOKEN\",\"unitPrice\":1,\"tokenUnit\":100000,\"enabled\":1},\n {\"itemCode\":\"ADD_WECHAT\",\"unit\":\"COUNT\",\"unitPrice\":0.5,\"enabled\":1},\n {\"itemCode\":\"OPEN_ACCOUNT_NON_AI\",\"unit\":\"TIME\",\"unitPrice\":1000,\"enabled\":1},\n {\"itemCode\":\"OPEN_ACCOUNT_AI\",\"unit\":\"TIME\",\"unitPrice\":3000,\"enabled\":1}\n ]\n}"
  29. }
  30. }
  31. },
  32. {
  33. "name": "3. 保存流量阶梯",
  34. "request": {
  35. "method": "POST",
  36. "header": [{ "key": "Content-Type", "value": "application/json" }],
  37. "url": { "raw": "{{baseUrl}}/api/fee/plan/flow-tier/save", "host": ["{{baseUrl}}"], "path": ["api","fee","plan","flow-tier","save"] },
  38. "body": {
  39. "mode": "raw",
  40. "raw": "{\n \"planCode\":\"STANDARD\",\n \"version\":1,\n \"tiers\":[\n {\"minPrepayAmount\":100000,\"maxPrepayAmount\":200000,\"unitPrice\":0.1,\"sortNo\":1},\n {\"minPrepayAmount\":200000,\"maxPrepayAmount\":null,\"unitPrice\":0.08,\"sortNo\":2}\n ]\n}"
  41. }
  42. }
  43. },
  44. {
  45. "name": "4. 发布方案",
  46. "request": {
  47. "method": "POST",
  48. "url": { "raw": "{{baseUrl}}/api/fee/plan/publish?planCode=STANDARD&version=1", "host": ["{{baseUrl}}"], "path": ["api","fee","plan","publish"], "query": [{"key":"planCode","value":"STANDARD"},{"key":"version","value":"1"}] }
  49. }
  50. },
  51. {
  52. "name": "5. 绑定租户方案",
  53. "request": {
  54. "method": "POST",
  55. "header": [{ "key": "Content-Type", "value": "application/json" }],
  56. "url": { "raw": "{{baseUrl}}/api/fee/tenant/bind-plan", "host": ["{{baseUrl}}"], "path": ["api","fee","tenant","bind-plan"] },
  57. "body": {
  58. "mode": "raw",
  59. "raw": "{\n \"tenantId\": 1,\n \"tenantType\": \"AI\",\n \"billingMode\": \"PREPAID\",\n \"planCode\": \"STANDARD\",\n \"planVersion\": 1\n}"
  60. }
  61. }
  62. },
  63. {
  64. "name": "6. 钱包充值",
  65. "request": {
  66. "method": "POST",
  67. "header": [{ "key": "Content-Type", "value": "application/json" }],
  68. "url": { "raw": "{{baseUrl}}/api/fee/wallet/recharge", "host": ["{{baseUrl}}"], "path": ["api","fee","wallet","recharge"] },
  69. "body": {
  70. "mode": "raw",
  71. "raw": "{\n \"tenantId\": 1,\n \"amount\": 100000,\n \"bizNo\": \"RC001\",\n \"remark\": \"预存充值\"\n}"
  72. }
  73. }
  74. },
  75. {
  76. "name": "7. 上报CALL事件(AI外呼)",
  77. "request": {
  78. "method": "POST",
  79. "header": [{ "key": "Content-Type", "value": "application/json" }],
  80. "url": { "raw": "{{baseUrl}}/api/fee/usage/report", "host": ["{{baseUrl}}"], "path": ["api","fee","usage","report"] },
  81. "body": {
  82. "mode": "raw",
  83. "raw": "{\n \"eventId\": \"evt_call_001\",\n \"tenantId\": 1,\n \"eventType\": \"CALL\",\n \"subType\": \"CALL_OUT\",\n \"bizId\": \"callBiz001\",\n \"usageValue\": 47,\n \"usageUnit\": \"SECOND\",\n \"extJson\": {\"isAiCall\": true}\n}"
  84. }
  85. }
  86. },
  87. {
  88. "name": "8. 查询计费明细",
  89. "request": {
  90. "method": "GET",
  91. "url": { "raw": "{{baseUrl}}/api/fee/billing/detail/list?tenantId=1", "host": ["{{baseUrl}}"], "path": ["api","fee","billing","detail","list"], "query": [{"key":"tenantId","value":"1"}] }
  92. }
  93. },
  94. {
  95. "name": "9. 生成账单",
  96. "request": {
  97. "method": "POST",
  98. "url": {
  99. "raw": "{{baseUrl}}/api/fee/statement/generate?tenantId=1&periodType=MONTHLY&periodStart=2026-04-01%2000:00:00&periodEnd=2026-04-30%2023:59:59",
  100. "host": ["{{baseUrl}}"],
  101. "path": ["api","fee","statement","generate"],
  102. "query": [
  103. {"key":"tenantId","value":"1"},
  104. {"key":"periodType","value":"MONTHLY"},
  105. {"key":"periodStart","value":"2026-04-01 00:00:00"},
  106. {"key":"periodEnd","value":"2026-04-30 23:59:59"}
  107. ]
  108. }
  109. }
  110. }
  111. ],
  112. "variable": [
  113. {
  114. "key": "baseUrl",
  115. "value": "http://127.0.0.1:8004"
  116. }
  117. ]
  118. }