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": {

View File

@@ -22,6 +22,93 @@
"host": "localhost:8000",
"basePath": "/app/api/v1",
"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.",
@@ -44,13 +131,6 @@
"schema": {
"$ref": "#/definitions/service_auth.ExchangeData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -151,13 +231,6 @@
"schema": {
"$ref": "#/definitions/service_auth.MagicData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -365,13 +438,6 @@
"schema": {
"$ref": "#/definitions/service_auth.RefreshData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -472,13 +538,6 @@
"schema": {
"$ref": "#/definitions/service_auth.TokenData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -579,13 +638,6 @@
"name": "event_id",
"in": "query",
"required": true
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -699,6 +751,13 @@
"name": "X-Api-Version",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Bearer token",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
@@ -881,6 +940,20 @@
],
"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",
@@ -956,13 +1029,6 @@
"name": "event_id",
"in": "query",
"required": true
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1086,13 +1152,6 @@
"schema": {
"$ref": "#/definitions/service_event.EventJoinData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1189,6 +1248,117 @@
}
}
},
"/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": [
@@ -1219,13 +1389,6 @@
"description": "Number of events to skip",
"name": "offset",
"in": "query"
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1334,13 +1497,6 @@
"schema": {
"$ref": "#/definitions/service_kyc.KycQueryData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1446,13 +1602,6 @@
"schema": {
"$ref": "#/definitions/service_kyc.KycSessionData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1549,15 +1698,6 @@
"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",
@@ -1659,13 +1799,6 @@
"name": "user_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1793,13 +1926,6 @@
"name": "offset",
"in": "query",
"required": true
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -1908,13 +2034,6 @@
"schema": {
"$ref": "#/definitions/service_user.UserInfoData"
}
},
{
"type": "string",
"description": "latest",
"name": "X-Api-Version",
"in": "header",
"required": true
}
],
"responses": {
@@ -2059,6 +2178,28 @@
}
}
},
"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": {

View File

@@ -42,6 +42,20 @@ definitions:
username:
type: string
type: object
service_agenda.SubmitData:
properties:
description:
type: string
event_id:
type: string
name:
type: string
type: object
service_agenda.SubmitResponse:
properties:
agenda_id:
type: string
type: object
service_auth.ExchangeData:
properties:
client_id:
@@ -205,6 +219,53 @@ info:
title: NixCN CMS API
version: "1.0"
paths:
/agenda/submit:
post:
consumes:
- application/json
description: Creates a new agenda item for a specific attendance record.
parameters:
- description: Agenda Submission Data
in: body
name: body
required: true
schema:
$ref: '#/definitions/service_agenda.SubmitData'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_agenda.SubmitResponse'
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
security:
- ApiKeyAuth: []
summary: Submit Agenda
tags:
- Agenda
/auth/exchange:
post:
consumes:
@@ -218,11 +279,6 @@ paths:
required: true
schema:
$ref: '#/definitions/service_auth.ExchangeData'
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -278,11 +334,6 @@ paths:
required: true
schema:
$ref: '#/definitions/service_auth.MagicData'
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -403,11 +454,6 @@ paths:
required: true
schema:
$ref: '#/definitions/service_auth.RefreshData'
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -463,11 +509,6 @@ paths:
required: true
schema:
$ref: '#/definitions/service_auth.TokenData'
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -520,11 +561,6 @@ paths:
name: event_id
required: true
type: string
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -588,6 +624,11 @@ paths:
name: X-Api-Version
required: true
type: string
- description: Bearer token
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
@@ -685,6 +726,16 @@ paths:
- application/json
description: Submits the generated code to mark the user as attended.
parameters:
- description: latest
in: header
name: X-Api-Version
required: true
type: string
- description: Bearer token
in: header
name: Authorization
required: true
type: string
- description: Checkin Code Data
in: body
name: payload
@@ -729,11 +780,6 @@ paths:
name: event_id
required: true
type: string
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -800,11 +846,6 @@ paths:
required: true
schema:
$ref: '#/definitions/service_event.EventJoinData'
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -858,6 +899,67 @@ paths:
summary: Join an Event
tags:
- Event
/event/joined:
get:
consumes:
- application/json
description: Fetches a list of events where the authenticated user is a participant.
Supports pagination.
parameters:
- description: Maximum number of events to return (default 20)
in: query
name: limit
type: integer
- description: Number of events to skip
in: query
name: offset
type: integer
produces:
- application/json
responses:
"200":
description: Successful retrieval of joined events
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
items:
$ref: '#/definitions/data.EventIndexDoc'
type: array
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
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: Get Joined Events
tags:
- Event
/event/list:
get:
consumes:
@@ -873,11 +975,6 @@ paths:
in: query
name: offset
type: integer
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -937,11 +1034,6 @@ paths:
required: true
schema:
$ref: '#/definitions/service_kyc.KycQueryData'
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -999,11 +1091,6 @@ paths:
required: true
schema:
$ref: '#/definitions/service_kyc.KycSessionData'
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -1054,12 +1141,6 @@ paths:
- application/json
description: Fetches the complete profile data for the user associated with
the provided session/token.
parameters:
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -1116,11 +1197,6 @@ paths:
name: user_id
required: true
type: string
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -1190,11 +1266,6 @@ paths:
name: offset
required: true
type: string
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses:
@@ -1255,11 +1326,6 @@ paths:
required: true
schema:
$ref: '#/definitions/service_user.UserInfoData'
- description: latest
in: header
name: X-Api-Version
required: true
type: string
produces:
- application/json
responses: