Add agenda service and submit api

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-02-06 18:32:46 +08:00
parent b2f216f1bd
commit c9e987e2ba
30 changed files with 1228 additions and 365 deletions

View File

@@ -24,6 +24,93 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/agenda/submit": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Creates a new agenda item for a specific attendance record.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Agenda"
],
"summary": "Submit Agenda",
"parameters": [
{
"description": "Agenda Submission Data",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service_agenda.SubmitData"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/service_agenda.SubmitResponse"
}
}
}
]
}
},
"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"
}
}
}
]
}
}
}
}
},
"/auth/exchange": {
"post": {
"description": "Exchanges client credentials and user session for a specific redirect authorization code.",
@@ -46,13 +133,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/service_auth.ExchangeData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -153,13 +233,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/service_auth.MagicData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -367,13 +440,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/service_auth.RefreshData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -474,13 +540,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/service_auth.TokenData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -581,13 +640,6 @@ const docTemplate = `{
"name": "event_id",
"in": "query",
"required": true
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -701,6 +753,13 @@ const docTemplate = `{
"name": "X-Api-Version",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Bearer token",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
@@ -883,6 +942,20 @@ const docTemplate = `{
],
"summary": "Submit Check-in Code",
"parameters": [
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Bearer token",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "Checkin Code Data",
"name": "payload",
@@ -958,13 +1031,6 @@ const docTemplate = `{
"name": "event_id",
"in": "query",
"required": true
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1088,13 +1154,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/service_event.EventJoinData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1191,6 +1250,117 @@ const docTemplate = `{
}
}
},
"/event/joined": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Fetches a list of events where the authenticated user is a participant. Supports pagination.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Event"
],
"summary": "Get Joined Events",
"parameters": [
{
"type": "integer",
"description": "Maximum number of events to return (default 20)",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Number of events to skip",
"name": "offset",
"in": "query"
}
],
"responses": {
"200": {
"description": "Successful retrieval of joined events",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/data.EventIndexDoc"
}
}
}
}
]
}
},
"400": {
"description": "Invalid Input",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.RespStatus"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"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"
}
}
}
]
}
}
}
}
},
"/event/list": {
"get": {
"security": [
@@ -1221,13 +1391,6 @@ const docTemplate = `{
"description": "Number of events to skip",
"name": "offset",
"in": "query"
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1336,13 +1499,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/service_kyc.KycQueryData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1448,13 +1604,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/service_kyc.KycSessionData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1551,15 +1700,6 @@ const docTemplate = `{
"User"
],
"summary": "Get My User Information",
"parameters": [
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "Successful profile retrieval",
@@ -1661,13 +1801,6 @@ const docTemplate = `{
"name": "user_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1795,13 +1928,6 @@ const docTemplate = `{
"name": "offset",
"in": "query",
"required": true
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1910,13 +2036,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/service_user.UserInfoData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -2061,6 +2180,28 @@ const docTemplate = `{
}
}
},
"service_agenda.SubmitData": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"event_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"service_agenda.SubmitResponse": {
"type": "object",
"properties": {
"agenda_id": {
"type": "string"
}
}
},
"service_auth.ExchangeData": {
"type": "object",
"properties": {