components:
responses:
# 成功响应
Success:
description: 操作成功
content:
application/xml:
schema:
$ref: './schemas.yaml#/components/schemas/BaseResponse'
example: |
1.0.1
00001
QueryRes
20240101
123456789012
AAAAAAA
成功
application/json:
schema:
$ref: './schemas.yaml#/components/schemas/BaseResponse'
example:
Version: "1.0.1"
InstId: "00001"
TranCode: "QueryRes"
TranDate: "20240101"
TranSeq: "123456789012"
RespCode: "AAAAAAA"
RespMessage: "成功"
# 业务错误响应
BusinessError:
description: 业务处理错误
content:
application/xml:
schema:
allOf:
- $ref: './schemas.yaml#/components/schemas/BaseResponse'
- type: object
properties:
ErrorDetail:
$ref: './schemas.yaml#/components/schemas/ErrorDetail'
example: |
1.0.1
00001
QueryRes
20240101
123456789012
DEF0001
无相应记录
DEF0001
用户编号123456不存在
2024-01-01 12:00:00
application/json:
schema:
allOf:
- $ref: './schemas.yaml#/components/schemas/BaseResponse'
- type: object
properties:
ErrorDetail:
$ref: './schemas.yaml#/components/schemas/ErrorDetail'
example:
Version: "1.0.1"
InstId: "00001"
TranCode: "QueryRes"
TranDate: "20240101"
TranSeq: "123456789012"
RespCode: "DEF0001"
RespMessage: "无相应记录"
ErrorDetail:
ErrorCode: "DEF0001"
ErrorMsg: "用户编号123456不存在"
ErrorTime: "2024-01-01T12:00:00.000Z"
# 系统错误响应
SystemError:
description: 系统异常错误
content:
application/xml:
schema:
allOf:
- $ref: './schemas.yaml#/components/schemas/BaseResponse'
- type: object
properties:
ErrorDetail:
$ref: './schemas.yaml#/components/schemas/ErrorDetail'
example: |
1.0.1
00001
QueryRes
20240101
123456789012
SYS1001
系统异常
SYS1001
数据库连接失败
2024-01-01 12:00:00
application/json:
schema:
allOf:
- $ref: './schemas.yaml#/components/schemas/BaseResponse'
- type: object
properties:
ErrorDetail:
$ref: './schemas.yaml#/components/schemas/ErrorDetail'
example:
Version: "1.0.1"
InstId: "00001"
TranCode: "QueryRes"
TranDate: "20240101"
TranSeq: "123456789012"
RespCode: "SYS1001"
RespMessage: "系统异常"
ErrorDetail:
ErrorCode: "SYS1001"
ErrorMsg: "数据库连接失败"
ErrorTime: "2024-01-01T12:00:00.000Z"
# 安全错误响应
SecurityError:
description: 安全验证错误
content:
application/xml:
schema:
allOf:
- $ref: './schemas.yaml#/components/schemas/BaseResponse'
- type: object
properties:
ErrorDetail:
$ref: './schemas.yaml#/components/schemas/ErrorDetail'
example: |
1.0.1
00001
QueryRes
20240101
123456789012
SEC2001
加密验证失败
SEC2001
数据解密失败
2024-01-01 12:00:00
application/json:
schema:
allOf:
- $ref: './schemas.yaml#/components/schemas/BaseResponse'
- type: object
properties:
ErrorDetail:
$ref: './schemas.yaml#/components/schemas/ErrorDetail'
example:
Version: "1.0.1"
InstId: "00001"
TranCode: "QueryRes"
TranDate: "20240101"
TranSeq: "123456789012"
RespCode: "SEC2001"
RespMessage: "加密验证失败"
ErrorDetail:
ErrorCode: "SEC2001"
ErrorMsg: "数据解密失败"
ErrorTime: "2024-01-01T12:00:00.000Z"
# 网络错误响应
NetworkError:
description: 网络通信错误
content:
application/xml:
schema:
allOf:
- $ref: './schemas.yaml#/components/schemas/BaseResponse'
- type: object
properties:
ErrorDetail:
$ref: './schemas.yaml#/components/schemas/ErrorDetail'
example: |
1.0.1
00001
QueryRes
20240101
123456789012
NET3001
网络超时
NET3001
请求超时,请稍后重试
2024-01-01 12:00:00
application/json:
schema:
allOf:
- $ref: './schemas.yaml#/components/schemas/BaseResponse'
- type: object
properties:
ErrorDetail:
$ref: './schemas.yaml#/components/schemas/ErrorDetail'
example:
Version: "1.0.1"
InstId: "00001"
TranCode: "QueryRes"
TranDate: "20240101"
TranSeq: "123456789012"
RespCode: "NET3001"
RespMessage: "网络超时"
ErrorDetail:
ErrorCode: "NET3001"
ErrorMsg: "请求超时,请稍后重试"
ErrorTime: "2024-01-01T12:00:00.000Z"