Fix swagger auth docs
Some checks failed
Backend Check Build (NixCN CMS) TeamCity build failed
Client CMS Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-29 01:28:19 +08:00
parent 654b196bfd
commit 937f382f93
7 changed files with 65 additions and 13 deletions

View File

@@ -20,7 +20,6 @@ import (
// @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input" // @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input"
// @Failure 401 {object} utils.RespStatus{data=nil} "Unauthorized" // @Failure 401 {object} utils.RespStatus{data=nil} "Unauthorized"
// @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error" // @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error"
// @Security ApiKeyAuth
// @Router /auth/exchange [post] // @Router /auth/exchange [post]
func (self *AuthHandler) Exchange(c *gin.Context) { func (self *AuthHandler) Exchange(c *gin.Context) {
var exchangeData service_auth.ExchangeData var exchangeData service_auth.ExchangeData

View File

@@ -19,6 +19,7 @@ import (
// @Success 200 {object} utils.RespStatus{data=service_event.CheckinResponse} "Successfully generated code" // @Success 200 {object} utils.RespStatus{data=service_event.CheckinResponse} "Successfully generated code"
// @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input" // @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input"
// @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error" // @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error"
// @Security ApiKeyAuth
// @Router /event/checkin [get] // @Router /event/checkin [get]
func (self *EventHandler) Checkin(c *gin.Context) { func (self *EventHandler) Checkin(c *gin.Context) {
userIdOrig, _ := c.Get("user_id") userIdOrig, _ := c.Get("user_id")
@@ -56,6 +57,7 @@ func (self *EventHandler) Checkin(c *gin.Context) {
// @Param payload body service_event.CheckinSubmitData true "Checkin Code Data" // @Param payload body service_event.CheckinSubmitData true "Checkin Code Data"
// @Success 200 {object} utils.RespStatus{data=nil} "Attendance marked successfully" // @Success 200 {object} utils.RespStatus{data=nil} "Attendance marked successfully"
// @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Code or Input" // @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Code or Input"
// @Security ApiKeyAuth
// @Router /event/checkin/submit [post] // @Router /event/checkin/submit [post]
func (self *EventHandler) CheckinSubmit(c *gin.Context) { func (self *EventHandler) CheckinSubmit(c *gin.Context) {
var data service_event.CheckinSubmitData var data service_event.CheckinSubmitData
@@ -89,6 +91,7 @@ func (self *EventHandler) CheckinSubmit(c *gin.Context) {
// @Success 200 {object} utils.RespStatus{data=service_event.CheckinQueryResponse} "Current attendance status" // @Success 200 {object} utils.RespStatus{data=service_event.CheckinQueryResponse} "Current attendance status"
// @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input" // @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input"
// @Failure 404 {object} utils.RespStatus{data=nil} "Record Not Found" // @Failure 404 {object} utils.RespStatus{data=nil} "Record Not Found"
// @Security ApiKeyAuth
// @Router /event/checkin/query [get] // @Router /event/checkin/query [get]
func (self *EventHandler) CheckinQuery(c *gin.Context) { func (self *EventHandler) CheckinQuery(c *gin.Context) {
userIdOrig, _ := c.Get("user_id") userIdOrig, _ := c.Get("user_id")

View File

@@ -20,6 +20,7 @@ import (
// @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input" // @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input"
// @Failure 404 {object} utils.RespStatus{data=nil} "Event Not Found" // @Failure 404 {object} utils.RespStatus{data=nil} "Event Not Found"
// @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error" // @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error"
// @Security ApiKeyAuth
// @Router /event/info [get] // @Router /event/info [get]
func (self *EventHandler) Info(c *gin.Context) { func (self *EventHandler) Info(c *gin.Context) {
eventIdOrig := c.Query("event_id") eventIdOrig := c.Query("event_id")

View File

@@ -19,6 +19,7 @@ import (
// @Success 200 {object} utils.RespStatus{data=[]data.UserSearchDoc} "Successful paginated list retrieval" // @Success 200 {object} utils.RespStatus{data=[]data.UserSearchDoc} "Successful paginated list retrieval"
// @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input (Format Error)" // @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input (Format Error)"
// @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error (Search Engine or Missing Offset)" // @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error (Search Engine or Missing Offset)"
// @Security ApiKeyAuth
// @Router /user/list [get] // @Router /user/list [get]
func (self *UserHandler) List(c *gin.Context) { func (self *UserHandler) List(c *gin.Context) {
type ListQuery struct { type ListQuery struct {

View File

@@ -17,11 +17,6 @@ const docTemplate = `{
"paths": { "paths": {
"/auth/exchange": { "/auth/exchange": {
"post": { "post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Exchanges client credentials and user session for a specific redirect authorization code.", "description": "Exchanges client credentials and user session for a specific redirect authorization code.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -529,6 +524,11 @@ const docTemplate = `{
}, },
"/event/checkin": { "/event/checkin": {
"get": { "get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Creates a temporary check-in code for the authenticated user and event.", "description": "Creates a temporary check-in code for the authenticated user and event.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -609,6 +609,11 @@ const docTemplate = `{
}, },
"/event/checkin/query": { "/event/checkin/query": {
"get": { "get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the timestamp of when the user checked in, or null if not yet checked in.", "description": "Returns the timestamp of when the user checked in, or null if not yet checked in.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -689,6 +694,11 @@ const docTemplate = `{
}, },
"/event/checkin/submit": { "/event/checkin/submit": {
"post": { "post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Submits the generated code to mark the user as attended.", "description": "Submits the generated code to mark the user as attended.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -753,6 +763,11 @@ const docTemplate = `{
}, },
"/event/info": { "/event/info": {
"get": { "get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Fetches the name, start time, and end time of an event using its UUID.", "description": "Fetches the name, start time, and end time of an event using its UUID.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -1003,6 +1018,11 @@ const docTemplate = `{
}, },
"/user/list": { "/user/list": {
"get": { "get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Fetches a list of users with support for pagination via limit and offset. Data is sourced from the search engine for high performance.", "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": [ "consumes": [
"application/json" "application/json"

View File

@@ -6,11 +6,6 @@
"paths": { "paths": {
"/auth/exchange": { "/auth/exchange": {
"post": { "post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Exchanges client credentials and user session for a specific redirect authorization code.", "description": "Exchanges client credentials and user session for a specific redirect authorization code.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -518,6 +513,11 @@
}, },
"/event/checkin": { "/event/checkin": {
"get": { "get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Creates a temporary check-in code for the authenticated user and event.", "description": "Creates a temporary check-in code for the authenticated user and event.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -598,6 +598,11 @@
}, },
"/event/checkin/query": { "/event/checkin/query": {
"get": { "get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the timestamp of when the user checked in, or null if not yet checked in.", "description": "Returns the timestamp of when the user checked in, or null if not yet checked in.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -678,6 +683,11 @@
}, },
"/event/checkin/submit": { "/event/checkin/submit": {
"post": { "post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Submits the generated code to mark the user as attended.", "description": "Submits the generated code to mark the user as attended.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -742,6 +752,11 @@
}, },
"/event/info": { "/event/info": {
"get": { "get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Fetches the name, start time, and end time of an event using its UUID.", "description": "Fetches the name, start time, and end time of an event using its UUID.",
"consumes": [ "consumes": [
"application/json" "application/json"
@@ -992,6 +1007,11 @@
}, },
"/user/list": { "/user/list": {
"get": { "get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Fetches a list of users with support for pagination via limit and offset. Data is sourced from the search engine for high performance.", "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": [ "consumes": [
"application/json" "application/json"

View File

@@ -209,8 +209,6 @@ paths:
data: data:
type: object type: object
type: object type: object
security:
- ApiKeyAuth: []
summary: Exchange Auth Code summary: Exchange Auth Code
tags: tags:
- Authentication - Authentication
@@ -486,6 +484,8 @@ paths:
data: data:
type: object type: object
type: object type: object
security:
- ApiKeyAuth: []
summary: Generate Check-in Code summary: Generate Check-in Code
tags: tags:
- Event - Event
@@ -531,6 +531,8 @@ paths:
data: data:
type: object type: object
type: object type: object
security:
- ApiKeyAuth: []
summary: Query Check-in Status summary: Query Check-in Status
tags: tags:
- Event - Event
@@ -567,6 +569,8 @@ paths:
data: data:
type: object type: object
type: object type: object
security:
- ApiKeyAuth: []
summary: Submit Check-in Code summary: Submit Check-in Code
tags: tags:
- Event - Event
@@ -621,6 +625,8 @@ paths:
data: data:
type: object type: object
type: object type: object
security:
- ApiKeyAuth: []
summary: Get Event Information summary: Get Event Information
tags: tags:
- Event - Event
@@ -754,6 +760,8 @@ paths:
data: data:
type: object type: object
type: object type: object
security:
- ApiKeyAuth: []
summary: List Users summary: List Users
tags: tags:
- User - User