Add event join service and api endpoint
All checks were successful
Backend Check Build (NixCN CMS) TeamCity build finished
Client CMS Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-31 11:58:56 +08:00
parent 82c476fa80
commit 1504954be4
6 changed files with 485 additions and 1 deletions

View File

@@ -909,6 +909,111 @@ const docTemplate = `{
}
}
},
"/event/join": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Allows an authenticated user to join an event by providing the event ID. The user's role and state are initialized by the service.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Event"
],
"summary": "Join an Event",
"parameters": [
{
"description": "Event Join Details (UserId and EventId are required)",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service_event.EventJoinData"
}
}
],
"responses": {
"200": {
"description": "Successfully joined the event",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"400": {
"description": "Invalid Input or UUID Parse Failed",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"403": {
"description": "Unauthorized / Missing User ID",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error / Database Error",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
}
},
"/event/list": {
"get": {
"security": [
@@ -1611,6 +1716,23 @@ const docTemplate = `{
}
}
},
"service_event.EventJoinData": {
"type": "object",
"properties": {
"event_id": {
"type": "string"
},
"role": {
"type": "string"
},
"state": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"service_user.UserInfoData": {
"type": "object",
"properties": {