Files
cms-server/docs/swagger.yaml
Asai Neko d187d8ef9a
All checks were successful
Server Check Build (NixCN CMS) TeamCity build finished
Fix attendanceData panic
Signed-off-by: Asai Neko <sugar@sne.moe>
2026-03-28 12:59:18 +08:00

2574 lines
66 KiB
YAML

basePath: /app/api/v1
definitions:
data.Agenda:
properties:
agenda_id:
type: string
attendance_id:
type: string
description:
description: base64 encoded markdown
type: string
end_time:
type: string
id:
type: integer
name:
type: string
start_time:
type: string
status:
description: pending | approved | rejected
type: string
uuid:
type: string
type: object
data.AgendaDoc:
properties:
agenda_id:
type: string
attendance_id:
type: string
description:
type: string
end_time:
type: string
name:
type: string
start_time:
type: string
status:
type: string
type: object
data.EventStatDoc:
properties:
checkin_count:
type: integer
event_id:
type: string
join_count:
type: integer
name:
type: string
type: object
data.PermissionLevelCount:
properties:
count:
type: integer
permission_level:
type: integer
type: object
service_agenda.AgendaListItem:
properties:
agenda_id:
type: string
attendance_id:
type: string
description:
type: string
end_time:
type: string
name:
type: string
start_time:
type: string
status:
type: string
user_profile:
$ref: '#/definitions/service_agenda.AgendaUserProfile'
type: object
service_agenda.AgendaReviewData:
properties:
agenda_id:
type: string
event_id:
type: string
status:
description: approved | rejected
type: string
required:
- agenda_id
- event_id
- status
type: object
service_agenda.AgendaScheduleData:
properties:
agenda_id:
type: string
end_time:
type: string
start_time:
type: string
required:
- agenda_id
- end_time
- start_time
type: object
service_agenda.AgendaUpdateData:
properties:
agenda_id:
type: string
description:
type: string
name:
type: string
required:
- agenda_id
type: object
service_agenda.AgendaUserProfile:
properties:
nickname:
type: string
user_id:
type: string
username:
type: string
type: object
service_agenda.SubmitData:
properties:
description:
type: string
event_id:
type: string
name:
type: string
required:
- description
- event_id
- name
type: object
service_agenda.SubmitResponse:
properties:
agenda_id:
type: string
type: object
service_auth.ExchangeData:
properties:
client_id:
type: string
redirect_uri:
type: string
state:
type: string
required:
- client_id
- redirect_uri
type: object
service_auth.ExchangeResponse:
properties:
redirect_uri:
type: string
required:
- redirect_uri
type: object
service_auth.MagicData:
properties:
client_id:
type: string
client_ip:
type: string
email:
type: string
redirect_uri:
type: string
state:
type: string
turnstile_token:
type: string
required:
- client_id
- email
- redirect_uri
- turnstile_token
type: object
service_auth.MagicResponse:
properties:
uri:
type: string
required:
- uri
type: object
service_auth.RefreshData:
properties:
refresh_token:
type: string
required:
- refresh_token
type: object
service_auth.TokenData:
properties:
code:
type: string
required:
- code
type: object
service_auth.TokenResponse:
properties:
access_token:
type: string
refresh_token:
type: string
required:
- access_token
- refresh_token
type: object
service_event.AttendanceGuideResponse:
properties:
attendance_guide:
type: string
required:
- attendance_guide
type: object
service_event.AttendanceListResponse:
properties:
attendance_id:
type: string
checked_in_at:
type: string
joined_at:
type: string
kyc_info: {}
kyc_status:
type: string
kyc_type:
type: string
user_info:
$ref: '#/definitions/service_user.UserInfoData'
required:
- attendance_id
- user_info
type: object
service_event.CheckinQueryResponse:
properties:
checkin_at:
type: string
type: object
service_event.CheckinResponse:
properties:
checkin_code:
type: string
required:
- checkin_code
type: object
service_event.CheckinSubmitData:
properties:
checkin_code:
type: string
required:
- checkin_code
type: object
service_event.EventCreateData:
properties:
attendance_guide:
type: string
description:
type: string
enable_kyc:
type: boolean
end_time:
type: string
limit:
type: integer
name:
type: string
quota:
type: integer
start_time:
type: string
subtitle:
type: string
thumbnail:
type: string
type:
type: string
required:
- name
- type
type: object
service_event.EventCreateResponse:
properties:
event_id:
type: string
required:
- event_id
type: object
service_event.EventDeleteData:
properties:
event_id:
type: string
required:
- event_id
type: object
service_event.EventInfoResponse:
properties:
checkin_count:
type: integer
description:
type: string
enable_kyc:
type: boolean
end_time:
type: string
event_id:
type: string
is_agenda_published:
type: boolean
is_checked_in:
type: boolean
is_joined:
type: boolean
join_count:
type: integer
limit:
type: integer
name:
type: string
owner:
type: string
quota:
type: integer
start_time:
type: string
subtitle:
type: string
thumbnail:
type: string
type:
type: string
required:
- enable_kyc
- end_time
- event_id
- name
- start_time
- subtitle
- type
type: object
service_event.EventJoinData:
properties:
event_id:
type: string
kyc_id:
type: string
required:
- event_id
type: object
service_event.EventJoinResponse:
properties:
attendance_id:
type: string
required:
- attendance_id
type: object
service_event.EventListItems:
properties:
checkin_count:
type: integer
description:
type: string
enable_kyc:
type: boolean
end_time:
type: string
event_id:
type: string
is_agenda_published:
type: boolean
is_checked_in:
type: boolean
is_joined:
type: boolean
join_count:
type: integer
name:
type: string
owner:
type: string
start_time:
type: string
subtitle:
type: string
thumbnail:
type: string
type:
type: string
required:
- enable_kyc
- end_time
- event_id
- name
- start_time
- subtitle
- type
type: object
service_event.EventListResponse:
properties:
items:
items:
$ref: '#/definitions/service_event.EventListItems'
type: array
total:
type: integer
type: object
service_event.EventStatsResponse:
properties:
agenda_submission_count:
type: integer
checkin_count:
type: integer
join_count:
type: integer
kyc_pass_rate:
type: number
type: object
service_event.EventUpdateData:
properties:
attendance_guide:
type: string
description:
type: string
end_time:
type: string
event_id:
type: string
is_agenda_published:
type: boolean
limit:
type: integer
name:
type: string
quota:
type: integer
start_time:
type: string
subtitle:
type: string
thumbnail:
type: string
required:
- event_id
type: object
service_kyc.KycQueryData:
properties:
kyc_id:
type: string
required:
- kyc_id
type: object
service_kyc.KycQueryResponse:
properties:
status:
description: success | pending | failed
type: string
required:
- status
type: object
service_kyc.KycSessionData:
properties:
identity:
description: base64 json
type: string
type:
description: cnrid | passport
type: string
required:
- identity
- type
type: object
service_kyc.KycSessionResponse:
properties:
kyc_id:
type: string
redirect_uri:
type: string
status:
description: success | processing
type: string
required:
- status
type: object
service_stats.GlobalStatsResponse:
properties:
event_join_checkin:
items:
$ref: '#/definitions/data.EventStatDoc'
type: array
total_users:
type: integer
users_per_level:
items:
$ref: '#/definitions/data.PermissionLevelCount'
type: array
type: object
service_user.UserInfoData:
properties:
allow_public:
type: boolean
avatar:
type: string
bio:
type: string
email:
type: string
nickname:
type: string
permission_level:
type: integer
subtitle:
type: string
user_id:
type: string
username:
type: string
required:
- allow_public
- email
- permission_level
- user_id
- username
type: object
service_user.UserInfoUpdateData:
properties:
allow_public:
type: boolean
avatar:
type: string
bio:
type: string
nickname:
type: string
permission_level:
type: integer
subtitle:
type: string
user_id:
type: string
username:
type: string
type: object
service_user.UserListResponse:
properties:
avatar:
type: string
email:
type: string
nickname:
type: string
permission_level:
type: integer
subtitle:
type: string
user_id:
type: string
username:
type: string
type: object
utils.RespStatus:
properties:
code:
type: integer
data: {}
error_id:
type: string
status:
type: string
required:
- code
- data
- error_id
- status
type: object
host: localhost:8000
info:
contact:
email: support@swagger.io
name: API Support
url: http://www.swagger.io/support
description: API Docs based on Gin framework
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: NixCN CMS API
version: "1.0"
paths:
/agenda/list:
get:
consumes:
- application/json
description: Returns all agendas for the specified event, regardless of status.
Manager only.
parameters:
- description: Event ID
in: query
name: event_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
items:
$ref: '#/definitions/service_agenda.AgendaListItem'
type: array
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event Not Found
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:
- Bearer: []
summary: List All Agendas
tags:
- Agenda
/agenda/my-list:
get:
consumes:
- application/json
description: Returns the calling user's agenda submissions for the specified
event. User must be a joined attendee (Lv10+).
parameters:
- description: Event ID
in: query
name: event_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
items:
$ref: '#/definitions/data.Agenda'
type: array
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Not an Attendee
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:
- Bearer: []
summary: My Agenda List
tags:
- Agenda
/agenda/review:
patch:
consumes:
- application/json
description: Manager sets the status of an agenda to approved or rejected. Not
allowed after agenda is published.
parameters:
- description: Review Data
in: body
name: body
required: true
schema:
$ref: '#/definitions/service_agenda.AgendaReviewData'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"400":
description: Invalid Input / Already Published
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event or Agenda Not Found
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:
- Bearer: []
summary: Review Agenda
tags:
- Agenda
/agenda/schedule:
get:
description: Returns all approved and scheduled agenda items, sorted by start_time
ascending. Returns 403 if the agenda has not been published.
parameters:
- description: Event ID
in: query
name: event_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
items:
$ref: '#/definitions/data.AgendaDoc'
type: array
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Agenda Not Published
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event Not Found
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:
- Bearer: []
summary: Get Agenda Schedule
tags:
- Agenda
patch:
consumes:
- application/json
description: Manager sets start_time and end_time on an approved agenda item.
Available even after publish.
parameters:
- description: Schedule Data
in: body
name: body
required: true
schema:
$ref: '#/definitions/service_agenda.AgendaScheduleData'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"400":
description: Invalid Input / Not Approved
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Agenda Not Found
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:
- Bearer: []
summary: Schedule Agenda
tags:
- Agenda
/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:
- Bearer: []
summary: Submit Agenda
tags:
- Agenda
/agenda/update:
patch:
consumes:
- application/json
description: Submitter may edit their own pending agendas before the event deadline.
Managers may edit any agenda with no restrictions.
parameters:
- description: Agenda Update Data
in: body
name: body
required: true
schema:
$ref: '#/definitions/service_agenda.AgendaUpdateData'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"400":
description: Invalid Input / Not Pending / Deadline Passed
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Not Submitter
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Agenda Not Found
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:
- Bearer: []
summary: Update Agenda
tags:
- Agenda
/auth/exchange:
post:
consumes:
- application/json
description: Exchanges client credentials and user session for a specific redirect
authorization code.
parameters:
- description: Exchange Request Credentials
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_auth.ExchangeData'
produces:
- application/json
responses:
"200":
description: Successful exchange
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_auth.ExchangeResponse'
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:
- Bearer: []
summary: Exchange Auth Code
tags:
- Authentication
/auth/magic:
post:
consumes:
- application/json
description: Verifies Turnstile token and sends an authentication link via email.
Returns the URI directly if debug mode is enabled.
parameters:
- description: Magic Link Request Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_auth.MagicData'
produces:
- application/json
responses:
"200":
description: Successful request
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_auth.MagicResponse'
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Turnstile Verification Failed
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: Request Magic Link
tags:
- Authentication
/auth/redirect:
get:
consumes:
- application/x-www-form-urlencoded
description: Verifies the temporary email code, ensures the user exists (or
creates one), validates the client's redirect URI, and finally performs a
302 redirect with a new authorization code.
parameters:
- description: Client Identifier
in: query
name: client_id
required: true
type: string
- description: Target Redirect URI
in: query
name: redirect_uri
required: true
type: string
- description: Temporary Verification Code
in: query
name: code
required: true
type: string
- description: Opaque state used to maintain state between the request and callback
in: query
name: state
type: string
produces:
- application/json
- text/html
responses:
"302":
description: Redirect to the provided RedirectUri with a new code
schema:
type: string
"400":
description: Invalid Input / Client Not Found / URI Mismatch
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Invalid or Expired Verification Code
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: Handle Auth Callback and Redirect
tags:
- Authentication
/auth/refresh:
post:
consumes:
- application/json
description: Accepts a valid refresh token to issue a new access token and a
rotated refresh token.
parameters:
- description: Refresh Token Body
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_auth.RefreshData'
produces:
- application/json
responses:
"200":
description: Successful rotation
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_auth.TokenResponse'
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
description: Invalid Refresh Token
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: Refresh Access Token
tags:
- Authentication
/auth/token:
post:
consumes:
- application/json
description: Verifies the provided authorization code and issues a pair of JWT
tokens (Access and Refresh).
parameters:
- description: Token Request Body
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_auth.TokenData'
produces:
- application/json
responses:
"200":
description: Successful token issuance
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_auth.TokenResponse'
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Invalid or Expired Code
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: Exchange Code for Token
tags:
- Authentication
/event/attendance:
get:
description: Retrieves the paginated list of attendees with optional filters.
Only accessible by the event owner (Manager). Supports name substring search
and KYC status filtering.
parameters:
- description: Event UUID
in: query
name: event_id
required: true
type: string
- description: Substring filter on attendee nickname
in: query
name: name
type: string
- description: 'KYC filter: ''with_kyc'' or ''without_kyc'''
in: query
name: kyc_status
type: string
- description: Maximum number of results to return (default 20)
in: query
name: limit
type: integer
- description: Number of results to skip (default 0)
in: query
name: offset
type: integer
- description: 'Sort field: ''checkin_at'' (default) or ''id'''
in: query
name: sort_by
type: string
- description: 'Sort direction: ''asc'' or ''desc'' (default)'
in: query
name: sort_order
type: string
produces:
- application/json
responses:
"200":
description: Successful retrieval
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
items:
$ref: '#/definitions/service_event.AttendanceListResponse'
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
"403":
description: Not Event Owner
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event Not Found
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:
- Bearer: []
summary: Get Attendance List
tags:
- Event
/event/checkin:
get:
consumes:
- application/json
description: Creates a temporary check-in code for the authenticated user and
event.
parameters:
- description: Event UUID
in: query
name: event_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Successfully generated code
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.CheckinResponse'
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
description: Missing User ID / 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:
- Bearer: []
summary: Generate Check-in Code
tags:
- Event
/event/checkin/query:
get:
consumes:
- application/json
description: Returns the timestamp of when the user checked in, or null if not
yet checked in.
parameters:
- description: Event UUID
in: query
name: event_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Current attendance status
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.CheckinQueryResponse'
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
/event/checkin/submit:
post:
consumes:
- application/json
description: Submits the generated code to mark the user as attended.
parameters:
- description: Checkin Code Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_event.CheckinSubmitData'
produces:
- application/json
responses:
"200":
description: Attendance marked successfully
schema:
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
security:
- Bearer: []
summary: Submit Check-in Code
tags:
- Event
/event/create:
post:
consumes:
- application/json
description: Allows a Lv30+ user to create a new event. Users at exactly Lv30
may only create events with type 'party'. Sets type and enable_kyc, which
are immutable after creation.
parameters:
- description: Event Creation Details
in: body
name: request
required: true
schema:
$ref: '#/definitions/service_event.EventCreateData'
produces:
- application/json
responses:
"200":
description: Successfully created the event
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.EventCreateResponse'
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
description: Missing User ID / Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Permission Denied / Type Not Allowed for this level
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error / Database Error
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- Bearer: []
summary: Create an Event
tags:
- Event
/event/delete:
delete:
consumes:
- application/json
description: Permanently deletes an event. Requires Lv40+.
parameters:
- description: Event to delete
in: body
name: request
required: true
schema:
$ref: '#/definitions/service_event.EventDeleteData'
produces:
- application/json
responses:
"200":
description: Successfully deleted
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
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
"404":
description: Event Not Found
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:
- Bearer: []
summary: Delete an Event
tags:
- Event
/event/guide:
get:
consumes:
- application/json
description: Fetching attendance guide of an event using its UUID.
parameters:
- description: Event UUID
in: query
name: event_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Successful retrieval
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.AttendanceGuideResponse'
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
description: Missing User ID / Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event Not Found
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:
- Bearer: []
summary: Get Event Guide
tags:
- Event
/event/info:
get:
consumes:
- application/json
description: Fetches the name, start time, and end time of an event using its
UUID.
parameters:
- description: Event UUID
in: query
name: event_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Successful retrieval
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.EventInfoResponse'
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
description: Missing User ID / Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event Not Found
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:
- Bearer: []
summary: Get Event Information
tags:
- Event
/event/join:
post:
consumes:
- application/json
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.
parameters:
- description: Event Join Details (UserId and EventId are required)
in: body
name: request
required: true
schema:
$ref: '#/definitions/service_event.EventJoinData'
produces:
- application/json
responses:
"200":
description: Successfully joined the event
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.EventJoinResponse'
type: object
"400":
description: Invalid Input or UUID Parse Failed
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"401":
description: Missing User ID / Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Unauthorized / Missing User ID / Event Limit Exceeded
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error / Database Error
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- Bearer: []
summary: Join an Event
tags:
- Event
/event/list:
get:
consumes:
- application/json
description: Returns a paginated list of events. Supports filtering by type
and sorting. Lv30 users are automatically scoped to events they own.
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
required: true
type: integer
- description: 'Filter by event type: ''official'' or ''party'''
in: query
name: type
type: string
- description: 'Sort field: ''start_time'' (default), ''end_time'', ''name'''
in: query
name: sort_by
type: string
- description: 'Sort direction: ''asc'' or ''desc'' (default)'
in: query
name: sort_order
type: string
produces:
- application/json
responses:
"200":
description: Successful paginated list retrieval
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.EventListResponse'
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:
- Bearer: []
summary: List Events
tags:
- Event
/event/stats:
get:
description: Returns join count, checkin count, KYC pass rate, and agenda submission
count. Only accessible by the event owner (Manager).
parameters:
- description: Event UUID
in: query
name: event_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Statistics retrieved successfully
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_event.EventStatsResponse'
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
"403":
description: Not Event Owner
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event Not Found
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:
- Bearer: []
summary: Get Event Statistics
tags:
- Event
/event/update:
patch:
consumes:
- application/json
description: 'Allows the event owner (Manager) to update name, subtitle, description,
start_time, end_time, thumbnail, and is_agenda_published. Changes to type
or enable_kyc are rejected. is_agenda_published is write-once: it can only
be set to true (requires at least one agenda submission) and cannot be reverted.'
parameters:
- description: Fields to update (all optional except event_id)
in: body
name: request
required: true
schema:
$ref: '#/definitions/service_event.EventUpdateData'
produces:
- application/json
responses:
"200":
description: Successfully updated
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"400":
description: Invalid Input / Immutable Field / Agenda Pre-flight Failed
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
"403":
description: Not Event Owner
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Event Not Found
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:
- Bearer: []
summary: Update an Event
tags:
- Event
/kyc/query:
post:
consumes:
- application/json
description: Checks the current state of a KYC session and updates local database
if approved.
parameters:
- description: KYC query data (KycId)
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_kyc.KycQueryData'
produces:
- application/json
responses:
"200":
description: Query processed (success/pending/failed)
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_kyc.KycQueryResponse'
type: object
"400":
description: Invalid UUID or input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
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:
- Bearer: []
summary: Query KYC Status
tags:
- KYC
/kyc/session:
post:
consumes:
- application/json
description: Initializes a KYC process (CNRid or Passport) and returns the status
or redirect URI.
parameters:
- description: KYC session data (Type and Base64 Identity)
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_kyc.KycSessionData'
produces:
- application/json
responses:
"200":
description: Session created successfully
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_kyc.KycSessionResponse'
type: object
"400":
description: Invalid input or decode failed
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Missing User ID
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error / KYC Service Error
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- Bearer: []
summary: Create KYC Session
tags:
- KYC
/stats/global:
get:
description: Returns total users, user counts per permission_level, and per-event
join/checkin counts.
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_stats.GlobalStatsResponse'
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:
- Bearer: []
summary: Global Stats
tags:
- Stats
/user/info:
get:
consumes:
- application/json
description: Fetches the complete profile data for the user associated with
the provided session/token.
produces:
- application/json
responses:
"200":
description: Successful profile retrieval
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_user.UserInfoData'
type: object
"401":
description: Missing User ID / Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: User Not Found
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error (UUID Parse Failed)
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- Bearer: []
summary: Get My User Information
tags:
- User
/user/info/{user_id}:
get:
consumes:
- application/json
description: Fetches the complete profile data for the user associated with
the provided session/token.
parameters:
- description: Other user id
in: path
name: user_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Successful profile retrieval
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
$ref: '#/definitions/service_user.UserInfoData'
type: object
"401":
description: Missing User ID / Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: User Not Public
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: User Not Found
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"500":
description: Internal Server Error (UUID Parse Failed)
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
security:
- Bearer: []
summary: Get Other User Information
tags:
- User
/user/list:
get:
consumes:
- application/json
description: Returns a paginated list of users with permission_level included.
Supports filtering by permission_level and sorting.
parameters:
- description: Maximum number of users to return (default 20)
in: query
name: limit
type: string
- description: Number of users to skip
in: query
name: offset
required: true
type: string
- description: 'Sort field: ''id'' (default) | ''permission_level'''
in: query
name: sort_by
type: string
- description: 'Sort direction: ''asc'' (default) | ''desc'''
in: query
name: sort_order
type: string
- description: Filter by exact permission level
in: query
name: permission_level
type: integer
produces:
- application/json
responses:
"200":
description: Successful paginated list retrieval
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
items:
$ref: '#/definitions/service_user.UserListResponse'
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:
- Bearer: []
summary: List Users (Admin)
tags:
- User
/user/update:
patch:
consumes:
- application/json
description: |-
Updates specific profile fields such as username, nickname, subtitle, avatar (URL), and bio (Base64).
Validation: Username (5-255 chars), Nickname (max 24 chars), Subtitle (max 32 chars).
parameters:
- description: Updated User Profile Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_user.UserInfoUpdateData'
produces:
- application/json
responses:
"200":
description: Successful profile update
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
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:
- Bearer: []
summary: Update User Information
tags:
- User
/user/update/{user_id}:
patch:
consumes:
- application/json
description: 'Lv40+ operators may update any user with a strictly lower permission_level.
Editable fields: all profile fields plus permission_level (new value must
be below operator''s own level).'
parameters:
- description: Target User ID
in: path
name: user_id
required: true
type: string
- description: Fields to update
in: body
name: payload
required: true
schema:
$ref: '#/definitions/service_user.UserInfoUpdateData'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"400":
description: Invalid Input
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"403":
description: Permission Matrix Violation
schema:
allOf:
- $ref: '#/definitions/utils.RespStatus'
- properties:
data:
type: object
type: object
"404":
description: Target User Not Found
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:
- Bearer: []
summary: Admin Update User
tags:
- User
schemes:
- http
- https
securityDefinitions:
Bearer:
in: header
name: Authorization
type: apiKey
swagger: "2.0"