Add service_kyc
All checks were successful
Client CMS Check Build (NixCN CMS) TeamCity build finished
Backend Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-02-01 13:15:17 +08:00
parent a2eb882398
commit 0ac96ab3e6
23 changed files with 1831 additions and 89 deletions

View File

@@ -104,6 +104,38 @@ definitions:
properties:
event_id:
type: string
kyc_id:
type: string
type: object
service_kyc.KycQueryData:
properties:
kyc_id:
type: string
type: object
service_kyc.KycQueryResponse:
properties:
status:
description: success | pending | failed
type: string
type: object
service_kyc.KycSessionData:
properties:
identity:
description: base64 json
type: string
type:
description: cnrid | passport
type: string
type: object
service_kyc.KycSessionResponse:
properties:
kyc_id:
type: string
redirect_uri:
type: string
status:
description: success | processing
type: string
type: object
service_user.UserInfoData:
properties:
@@ -769,6 +801,120 @@ paths:
summary: List Events
tags:
- Event
/kyc/query:
post:
consumes:
- application/json
description: Checks the current state of a KYC session and updates local database
if approved.
parameters:
- description: KYC query data (KycId)
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_kyc.KycQueryData'
produces:
- application/json
responses:
"200":
description: Query processed (success/pending/failed)
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_kyc.KycQueryResponse'
type: object
"400":
description: Invalid UUID or input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- ApiKeyAuth: []
summary: Query KYC Status
tags:
- KYC
/kyc/session:
post:
consumes:
- application/json
description: Initializes a KYC process (CNRid or Passport) and returns the status
or redirect URI.
parameters:
- description: KYC session data (Type and Base64 Identity)
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_kyc.KycSessionData'
produces:
- application/json
responses:
"200":
description: Session created successfully
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_kyc.KycSessionResponse'
type: object
"400":
description: Invalid input or decode failed
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Missing User ID
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error / KYC Service Error
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- ApiKeyAuth: []
summary: Create KYC Session
tags:
- KYC
/user/info:
get:
consumes: