risk-check-api.yaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. openapi: 3.0.3
  2. info:
  3. title: 供应链金融平台风险检查API
  4. description: 提供供应链金融平台的风险评估服务
  5. version: 1.0.0
  6. contact:
  7. name: 供应链金融平台开发团队
  8. email: support@gulop.com
  9. servers:
  10. - url: https://api.gulop.com
  11. description: 生产环境
  12. - url: https://test-api.gulop.com
  13. description: 测试环境
  14. paths:
  15. /api/v1/risk-check:
  16. post:
  17. summary: 风险评估检查
  18. description: 对账单进行风险评估检查
  19. tags:
  20. - 风险管理
  21. requestBody:
  22. required: true
  23. content:
  24. application/json:
  25. schema:
  26. $ref: '#/components/schemas/RiskCheckRequest'
  27. example:
  28. billNo: "EB20250701123456"
  29. creditScore: 780
  30. responses:
  31. '200':
  32. description: 风险评估成功
  33. content:
  34. application/json:
  35. schema:
  36. $ref: '#/components/schemas/RiskCheckSuccessResponse'
  37. example:
  38. code: 200
  39. message: "风险评估通过"
  40. data:
  41. riskLevel: "LOW"
  42. approved: true
  43. maxAmount: 500000
  44. evaluationDate: "2025-07-01T10:15:30Z"
  45. '400':
  46. description: 请求参数错误
  47. content:
  48. application/json:
  49. schema:
  50. $ref: '#/components/schemas/ErrorResponse'
  51. example:
  52. code: 400
  53. message: "请求参数错误"
  54. errors:
  55. - field: "billNo"
  56. message: "账单号格式不正确"
  57. '401':
  58. description: 未授权
  59. content:
  60. application/json:
  61. schema:
  62. $ref: '#/components/schemas/ErrorResponse'
  63. example:
  64. code: 401
  65. message: "未授权,请先登录"
  66. '500':
  67. description: 服务器错误
  68. content:
  69. application/json:
  70. schema:
  71. $ref: '#/components/schemas/ErrorResponse'
  72. example:
  73. code: 500
  74. message: "服务器内部错误"
  75. components:
  76. schemas:
  77. RiskCheckRequest:
  78. type: object
  79. required:
  80. - billNo
  81. - creditScore
  82. properties:
  83. billNo:
  84. type: string
  85. description: 账单编号
  86. example: "EB20250701123456"
  87. creditScore:
  88. type: integer
  89. description: 信用评分
  90. minimum: 300
  91. maximum: 850
  92. example: 780
  93. RiskCheckSuccessResponse:
  94. type: object
  95. properties:
  96. code:
  97. type: integer
  98. description: 状态码
  99. example: 200
  100. message:
  101. type: string
  102. description: 响应消息
  103. example: "风险评估通过"
  104. data:
  105. type: object
  106. properties:
  107. riskLevel:
  108. type: string
  109. description: 风险等级(LOW, MEDIUM, HIGH)
  110. enum: [LOW, MEDIUM, HIGH]
  111. example: "LOW"
  112. approved:
  113. type: boolean
  114. description: 是否通过风险检查
  115. example: true
  116. maxAmount:
  117. type: number
  118. description: 最大授信额度
  119. example: 500000
  120. evaluationDate:
  121. type: string
  122. format: date-time
  123. description: 评估时间
  124. example: "2025-07-01T10:15:30Z"
  125. ErrorResponse:
  126. type: object
  127. properties:
  128. code:
  129. type: integer
  130. description: 错误码
  131. example: 400
  132. message:
  133. type: string
  134. description: 错误消息
  135. example: "请求参数错误"
  136. errors:
  137. type: array
  138. items:
  139. type: object
  140. properties:
  141. field:
  142. type: string
  143. description: 错误字段
  144. example: "billNo"
  145. message:
  146. type: string
  147. description: 错误详情
  148. example: "账单号格式不正确"