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

@@ -35,27 +35,75 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Successful exchange",
"schema": {
"$ref": "#/definitions/service_auth.ExchangeResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_auth.ExchangeResult"
}
}
}
]
}
},
"400": {
"description": "Invalid Input",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -87,27 +135,75 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Successful request",
"schema": {
"$ref": "#/definitions/service_auth.MagicResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_auth.MagicResult"
}
}
}
]
}
},
"400": {
"description": "Invalid Input",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"403": {
"description": "Turnstile Verification Failed",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -120,6 +216,7 @@
"application/x-www-form-urlencoded"
],
"produces": [
"application/json",
"text/html"
],
"tags": [
@@ -165,19 +262,55 @@
"400": {
"description": "Invalid Input / Client Not Found / URI Mismatch",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"403": {
"description": "Invalid or Expired Verification Code",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -209,27 +342,75 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Successful rotation",
"schema": {
"$ref": "#/definitions/service_auth.RefreshResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_auth.TokenResponse"
}
}
}
]
}
},
"400": {
"description": "Invalid Input",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"401": {
"description": "Invalid Refresh Token",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -261,27 +442,75 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Successful token issuance",
"schema": {
"$ref": "#/definitions/service_auth.TokenResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_auth.TokenResponse"
}
}
}
]
}
},
"400": {
"description": "Invalid Input",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"403": {
"description": "Invalid or Expired Code",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -311,9 +540,57 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Successfully generated code",
"schema": {
"$ref": "#/definitions/service_event.CheckinResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_event.CheckinResult"
}
}
}
]
}
},
"400": {
"description": "Invalid Input",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -343,9 +620,57 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Current attendance status",
"schema": {
"$ref": "#/definitions/service_event.CheckinQueryResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_event.CheckinQueryResult"
}
}
}
]
}
},
"400": {
"description": "Invalid Input",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"404": {
"description": "Record Not Found",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -377,9 +702,39 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Attendance marked successfully",
"schema": {
"$ref": "#/definitions/service_event.CheckinSubmitResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"400": {
"description": "Invalid Code or Input",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -409,27 +764,75 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Successful retrieval",
"schema": {
"$ref": "#/definitions/service_event.InfoResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_event.InfoResult"
}
}
}
]
}
},
"400": {
"description": "Invalid Input",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"404": {
"description": "Event Not Found",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -455,15 +858,39 @@
"summary": "Get Full User Table",
"responses": {
"200": {
"description": "OK",
"description": "Successful retrieval of full user table",
"schema": {
"$ref": "#/definitions/service_user.UserTableResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_user.UserTableResult"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error (Database Error)",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -489,27 +916,75 @@
"summary": "Get My User Information",
"responses": {
"200": {
"description": "OK",
"description": "Successful profile retrieval",
"schema": {
"$ref": "#/definitions/service_user.UserInfoResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_user.UserInfoData"
}
}
}
]
}
},
"403": {
"description": "Missing User ID / Unauthorized",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"404": {
"description": "User Not Found",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error (UUID Parse Failed)",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -517,7 +992,7 @@
},
"/user/list": {
"get": {
"description": "Fetches a list of users with support for pagination via limit and offset.",
"description": "Fetches a list of users with support for pagination via limit and offset. Data is sourced from the search engine for high performance.",
"consumes": [
"application/json"
],
@@ -545,21 +1020,60 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Successful paginated list retrieval",
"schema": {
"$ref": "#/definitions/service_user.UserListResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/data.UserSearchDoc"
}
}
}
}
]
}
},
"400": {
"description": "Invalid Input (Format Error)",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error (Search Engine or Missing Offset)",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -596,27 +1110,75 @@
],
"responses": {
"200": {
"description": "OK",
"description": "Successful profile update",
"schema": {
"$ref": "#/definitions/service_user.UserInfoResult"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"400": {
"description": "Invalid Input (Validation Failed)",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"403": {
"description": "Missing User ID / Unauthorized",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error (Database Error / UUID Parse Failed)",
"schema": {
"type": "string"
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
@@ -782,17 +1344,6 @@
}
}
},
"service_auth.RefreshResult": {
"type": "object",
"properties": {
"common": {
"$ref": "#/definitions/shared.CommonResult"
},
"data": {
"$ref": "#/definitions/service_auth.TokenResponse"
}
}
},
"service_auth.TokenData": {
"type": "object",
"properties": {
@@ -812,17 +1363,6 @@
}
}
},
"service_auth.TokenResult": {
"type": "object",
"properties": {
"common": {
"$ref": "#/definitions/shared.CommonResult"
},
"data": {
"$ref": "#/definitions/service_auth.TokenResponse"
}
}
},
"service_event.CheckinQueryResult": {
"type": "object",
"properties": {
@@ -863,14 +1403,6 @@
}
}
},
"service_event.CheckinSubmitResult": {
"type": "object",
"properties": {
"common": {
"$ref": "#/definitions/shared.CommonResult"
}
}
},
"service_event.InfoResult": {
"type": "object",
"properties": {
@@ -925,31 +1457,6 @@
}
}
},
"service_user.UserInfoResult": {
"type": "object",
"properties": {
"common": {
"$ref": "#/definitions/shared.CommonResult"
},
"data": {
"$ref": "#/definitions/service_user.UserInfoData"
}
}
},
"service_user.UserListResult": {
"type": "object",
"properties": {
"common": {
"$ref": "#/definitions/shared.CommonResult"
},
"user_list": {
"type": "array",
"items": {
"$ref": "#/definitions/data.UserSearchDoc"
}
}
}
},
"service_user.UserTableResult": {
"type": "object",
"properties": {
@@ -974,6 +1481,21 @@
"type": "integer"
}
}
},
"utils.RespStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {},
"error_id": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
}
}