Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 1 | components: |
| 2 | schemas: |
| 3 | AccountQueryRequest: |
| 4 | type: object |
| 5 | title: 账户查询请求 |
| 6 | required: |
| 7 | - userid |
| 8 | properties: |
| 9 | userid: |
| 10 | title: 用户ID |
| 11 | type: string |
| 12 | subaccounts: |
| 13 | title: 子账户列表 |
| 14 | type: array |
| 15 | items: |
| 16 | type: string |
| 17 | title: 子账户ID |
| 18 | AccountQueryResponse: |
| 19 | type: object |
| 20 | title: 账户查询应答 |
| 21 | properties: |
| 22 | userid: |
| 23 | title: 用户ID |
| 24 | type: string |
| 25 | username: |
| 26 | title: 用户名 |
| 27 | type: string |
| 28 | status: |
| 29 | title: 账户状态 |
| 30 | $ref: 'definitions.yaml#/components/schemas/UserStatus' |
| 31 | balance: |
| 32 | title: 总余额(分) |
| 33 | type: integer |
| 34 | frozenbal: |
| 35 | title: 冻结金额(分) |
| 36 | type: integer |
| 37 | subaccountList: |
| 38 | type: array |
| 39 | title: 子账户列表 |
| 40 | items: |
| 41 | title: 子账户属性 |
| 42 | $ref: 'definitions.yaml#/components/schemas/SubAccountMetadata' |
| 43 | PreAuthorizedDebitRequest: |
| 44 | type: object |
| 45 | title: 预授权交易请求 |
| 46 | required: |
| 47 | - userid |
| 48 | - accountType |
| 49 | - preAuthorizedAmount |
| 50 | - shopaccno |
| 51 | - transDate |
| 52 | - transTime |
| 53 | properties: |
| 54 | billno: |
| 55 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 56 | userid: |
| 57 | title: 用户ID |
| 58 | type: string |
| 59 | accountType: |
| 60 | title: 账户类型 |
| 61 | type: string |
| 62 | preAuthorizedAmount: |
| 63 | title: 预授权金额(分) |
| 64 | type: integer |
| 65 | shopaccno: |
| 66 | $ref: 'definitions.yaml#/components/schemas/ShopAccNo' |
| 67 | transDate: |
| 68 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 69 | transTime: |
| 70 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 71 | PreAuthorizedDebitResponse: |
| 72 | type: object |
| 73 | title: 预授权交易应答 |
| 74 | properties: |
| 75 | refno: |
| 76 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 77 | result: |
| 78 | $ref: 'definitions.yaml#/components/schemas/TransResult' |
| 79 | message: |
| 80 | type: string |
| 81 | title: 预授权交易信息 |
| 82 | PreAuthorizedSettleRequest: |
| 83 | type: object |
| 84 | title: 预授权交易清算 |
| 85 | required: |
| 86 | - refno |
| 87 | - billno |
| 88 | - transTime |
| 89 | - transTime |
| 90 | - amount |
| 91 | properties: |
| 92 | refno: |
| 93 | title: 预授权交易系统交易参考号 |
| 94 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 95 | billno: |
| 96 | title: 预授权交易清算订单号 |
| 97 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 98 | transDate: |
| 99 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 100 | transTime: |
| 101 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 102 | amount: |
| 103 | title: 清算金额, 小于等于预授权金额(分) |
| 104 | type: integer |
| 105 | PreAuthorizedSettleResponse: |
| 106 | type: object |
| 107 | title: 预授权交易清算结果 |
| 108 | properties: |
| 109 | refno: |
| 110 | title: 预授权交易清算交易系统交易参考号 |
| 111 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 112 | leftPreAuthorizedAmount: |
| 113 | title: 清算后剩余预授权金额 |
| 114 | type: integer |
| 115 | AccountPayRequest: |
| 116 | type: object |
| 117 | title: 账户余额扣款交易 |
| 118 | required: |
| 119 | - billno |
| 120 | - shopaccno |
| 121 | - transTime |
| 122 | - transDate |
| 123 | - userid |
| 124 | - amount |
| 125 | - dtltype |
| 126 | properties: |
| 127 | billno: |
| 128 | title: 交易订单号 |
| 129 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 130 | shopaccno: |
| 131 | $ref: 'definitions.yaml#/components/schemas/ShopAccNo' |
| 132 | transDate: |
| 133 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 134 | transTime: |
| 135 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 136 | userid: |
| 137 | title: 用户ID |
| 138 | type: string |
| 139 | amount: |
| 140 | title: 扣款金额(分) |
| 141 | type: integer |
| 142 | description: |
| 143 | title: 交易描述 |
| 144 | type: string |
| 145 | dtltype: |
| 146 | title: 交易类型 |
| 147 | type: string |
| 148 | default: "pos" |
| 149 | AccountPayResponse: |
| 150 | type: object |
| 151 | title: 账户余额扣款交易应答 |
| 152 | properties: |
| 153 | refno: |
| 154 | title: 系统交易参考号 |
| 155 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 156 | description: |
| 157 | title: 系统返回交易描述 |
| 158 | type: string |
| 159 | aftbal: |
| 160 | title: 账户余额(分) |
| 161 | type: integer |
| 162 | |
| 163 | |
| 164 | paths: |
| 165 | accountQuery: |
| 166 | parameters: |
| 167 | - $ref: definitions.yaml#/components/headers/TenantId |
| 168 | post: |
| 169 | tags: |
| 170 | - pos |
| 171 | requestBody: |
| 172 | description: 账户余额查询 |
| 173 | content: |
| 174 | application/json: |
| 175 | schema: |
| 176 | $ref: '#/components/schemas/AccountQueryRequest' |
| 177 | responses: |
| 178 | '200': |
| 179 | description: 查询账户成功 |
| 180 | content: |
| 181 | application/json: |
| 182 | schema: |
| 183 | $ref: '#/components/schemas/AccountQueryResponse' |
| 184 | '404': |
| 185 | description: 指定用户不存在 |
| 186 | content: |
| 187 | application/json: |
| 188 | schema: |
| 189 | $ref: 'definitions.yaml#/components/schemas/ErrorResponse' |
| 190 | default: |
| 191 | description: 查询错误 |
| 192 | content: |
| 193 | application/json: |
| 194 | schema: |
| 195 | $ref: 'definitions.yaml#/components/schemas/ErrorResponse' |
| 196 | accountPay: |
| 197 | parameters: |
| 198 | - $ref: definitions.yaml#/components/headers/TenantId |
| 199 | post: |
| 200 | tags: |
| 201 | - pos |
| 202 | requestBody: |
| 203 | description: 账户余额消费 |
| 204 | content: |
| 205 | application/json: |
| 206 | schema: |
| 207 | $ref: '#/components/schemas/AccountPayRequest' |
| 208 | responses: |
| 209 | '200': |
| 210 | description: 账户消费成功 |
| 211 | content: |
| 212 | application/json: |
| 213 | schema: |
| 214 | $ref: '#/components/schemas/AccountPayResponse' |
| 215 | default: |
| 216 | description: 消费失败 |
| 217 | content: |
| 218 | application/json: |
| 219 | schema: |
| 220 | $ref: 'definitions.yaml#/components/schemas/ErrorResponse' |
| 221 | accountPreAuthorizedDebit: |
| 222 | parameters: |
| 223 | - $ref: definitions.yaml#/components/headers/TenantId |
| 224 | post: |
| 225 | tags: |
| 226 | - pos |
| 227 | requestBody: |
| 228 | description: 账户预授权交易 |
| 229 | content: |
| 230 | application/json: |
| 231 | schema: |
| 232 | $ref: '#/components/schemas/PreAuthorizedDebitRequest' |
| 233 | responses: |
| 234 | '200': |
| 235 | description: 预授权交易成功 |
| 236 | content: |
| 237 | application/json: |
| 238 | schema: |
| 239 | $ref: '#/components/schemas/PreAuthorizedDebitResponse' |
| 240 | accountPreAuthorizedSettle: |
| 241 | parameters: |
| 242 | - $ref: definitions.yaml#/components/headers/TenantId |
| 243 | post: |
| 244 | tags: |
| 245 | - pos |
| 246 | requestBody: |
| 247 | description: 预授权交易清算 |
| 248 | content: |
| 249 | application/json: |
| 250 | schema: |
| 251 | $ref: '#/components/schemas/PreAuthorizedSettleRequest' |
| 252 | |
| 253 | responses: |
| 254 | '200': |
| 255 | description: 预授权交易清算成功 |
| 256 | content: |
| 257 | application/json: |
| 258 | schema: |
| 259 | $ref: '#/components/schemas/PreAuthorizedSettleResponse' |
| 260 | |