Generate swagger docs
Some checks failed
Client CMS Check Build (NixCN CMS) TeamCity build finished
Backend Check Build (NixCN CMS) TeamCity build failed

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-29 00:59:49 +08:00
parent 330b037dca
commit 732d9866db
3 changed files with 1563 additions and 301 deletions

View File

@@ -102,13 +102,6 @@ definitions:
refresh_token:
type: string
type: object
service_auth.RefreshResult:
properties:
common:
$ref: '#/definitions/shared.CommonResult'
data:
$ref: '#/definitions/service_auth.TokenResponse'
type: object
service_auth.TokenData:
properties:
code:
@@ -121,13 +114,6 @@ definitions:
refresh_token:
type: string
type: object
service_auth.TokenResult:
properties:
common:
$ref: '#/definitions/shared.CommonResult'
data:
$ref: '#/definitions/service_auth.TokenResponse'
type: object
service_event.CheckinQueryResult:
properties:
common:
@@ -153,11 +139,6 @@ definitions:
checkin_code:
type: string
type: object
service_event.CheckinSubmitResult:
properties:
common:
$ref: '#/definitions/shared.CommonResult'
type: object
service_event.InfoResult:
properties:
common:
@@ -193,22 +174,6 @@ definitions:
username:
type: string
type: object
service_user.UserInfoResult:
properties:
common:
$ref: '#/definitions/shared.CommonResult'
data:
$ref: '#/definitions/service_user.UserInfoData'
type: object
service_user.UserListResult:
properties:
common:
$ref: '#/definitions/shared.CommonResult'
user_list:
items:
$ref: '#/definitions/data.UserSearchDoc'
type: array
type: object
service_user.UserTableResult:
properties:
common:
@@ -225,6 +190,16 @@ definitions:
httpCode:
type: integer
type: object
utils.RespStatus:
properties:
code:
type: integer
data: {}
error_id:
type: string
status:
type: string
type: object
info:
contact: {}
paths:
@@ -245,21 +220,41 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful exchange
schema:
$ref: '#/definitions/service_auth.ExchangeResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_auth.ExchangeResult'
type: object
"400":
description: Invalid Input
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
description: Unauthorized
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- ApiKeyAuth: []
summary: Exchange Auth Code
@@ -282,21 +277,41 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful request
schema:
$ref: '#/definitions/service_auth.MagicResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_auth.MagicResult'
type: object
"400":
description: Invalid Input
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Turnstile Verification Failed
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
summary: Request Magic Link
tags:
- Authentication
@@ -328,6 +343,7 @@ paths:
name: state
type: string
produces:
- application/json
- text/html
responses:
"302":
@@ -337,15 +353,30 @@ paths:
"400":
description: Invalid Input / Client Not Found / URI Mismatch
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Invalid or Expired Verification Code
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
summary: Handle Auth Callback and Redirect
tags:
- Authentication
@@ -366,21 +397,41 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful rotation
schema:
$ref: '#/definitions/service_auth.RefreshResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_auth.TokenResponse'
type: object
"400":
description: Invalid Input
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
description: Invalid Refresh Token
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
summary: Refresh Access Token
tags:
- Authentication
@@ -401,21 +452,41 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful token issuance
schema:
$ref: '#/definitions/service_auth.TokenResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_auth.TokenResponse'
type: object
"400":
description: Invalid Input
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Invalid or Expired Code
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
summary: Exchange Code for Token
tags:
- Authentication
@@ -435,9 +506,32 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successfully generated code
schema:
$ref: '#/definitions/service_event.CheckinResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.CheckinResult'
type: object
"400":
description: Invalid Input
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
summary: Generate Check-in Code
tags:
- Event
@@ -457,9 +551,32 @@ paths:
- application/json
responses:
"200":
description: OK
description: Current attendance status
schema:
$ref: '#/definitions/service_event.CheckinQueryResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.CheckinQueryResult'
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Record Not Found
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
summary: Query Check-in Status
tags:
- Event
@@ -479,9 +596,23 @@ paths:
- application/json
responses:
"200":
description: OK
description: Attendance marked successfully
schema:
$ref: '#/definitions/service_event.CheckinSubmitResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"400":
description: Invalid Code or Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
summary: Submit Check-in Code
tags:
- Event
@@ -501,21 +632,41 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful retrieval
schema:
$ref: '#/definitions/service_event.InfoResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.InfoResult'
type: object
"400":
description: Invalid Input
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event Not Found
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
summary: Get Event Information
tags:
- Event
@@ -529,13 +680,23 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful retrieval of full user table
schema:
$ref: '#/definitions/service_user.UserTableResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_user.UserTableResult'
type: object
"500":
description: Internal Server Error (Database Error)
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- ApiKeyAuth: []
summary: Get Full User Table
@@ -551,21 +712,41 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful profile retrieval
schema:
$ref: '#/definitions/service_user.UserInfoResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_user.UserInfoData'
type: object
"403":
description: Missing User ID / Unauthorized
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: User Not Found
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error (UUID Parse Failed)
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- ApiKeyAuth: []
summary: Get My User Information
@@ -576,7 +757,7 @@ paths:
consumes:
- application/json
description: Fetches a list of users with support for pagination via limit and
offset.
offset. Data is sourced from the search engine for high performance.
parameters:
- description: Maximum number of users to return (default 0)
in: query
@@ -591,17 +772,34 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful paginated list retrieval
schema:
$ref: '#/definitions/service_user.UserListResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
items:
$ref: '#/definitions/data.UserSearchDoc'
type: array
type: object
"400":
description: Invalid Input (Format Error)
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error (Search Engine or Missing Offset)
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
summary: List Users
tags:
- User
@@ -623,21 +821,41 @@ paths:
- application/json
responses:
"200":
description: OK
description: Successful profile update
schema:
$ref: '#/definitions/service_user.UserInfoResult'
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"400":
description: Invalid Input (Validation Failed)
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Missing User ID / Unauthorized
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error (Database Error / UUID Parse Failed)
schema:
type: string
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- ApiKeyAuth: []
summary: Update User Information