diff --git a/docs/docs.go b/docs/docs.go
index 109300677..dbaa05fba 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -336,6 +336,11 @@ const docTemplate = `{
},
"/answer/admin/api/language/options": {
"get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "Get language options",
"produces": [
"application/json"
@@ -690,6 +695,11 @@ const docTemplate = `{
},
"/answer/admin/api/roles": {
"get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "get role list",
"produces": [
"application/json"
@@ -2296,11 +2306,6 @@ const docTemplate = `{
},
"/answer/api/v1/answer/page": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "AnswerList \u003cbr\u003e \u003cb\u003eorder\u003c/b\u003e (default or updated)",
"consumes": [
"application/json"
@@ -2393,11 +2398,6 @@ const docTemplate = `{
},
"/answer/api/v1/badge": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get badge info",
"consumes": [
"application/json"
@@ -2443,11 +2443,6 @@ const docTemplate = `{
},
"/answer/api/v1/badge/awards/page": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get badge award list",
"consumes": [
"application/json"
@@ -2510,11 +2505,6 @@ const docTemplate = `{
},
"/answer/api/v1/badge/user/awards": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get user badge award list",
"consumes": [
"application/json"
@@ -2562,11 +2552,6 @@ const docTemplate = `{
},
"/answer/api/v1/badge/user/awards/recent": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get user badge award list",
"consumes": [
"application/json"
@@ -2614,11 +2599,6 @@ const docTemplate = `{
},
"/answer/api/v1/badges": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "list all badges group by group",
"consumes": [
"application/json"
@@ -3365,11 +3345,6 @@ const docTemplate = `{
},
"/answer/api/v1/meta/reaction": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get reaction for an object",
"consumes": [
"application/json"
@@ -3934,11 +3909,6 @@ const docTemplate = `{
},
"/answer/api/v1/personal/qa/top": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "UserTop",
"consumes": [
"application/json"
@@ -4157,11 +4127,6 @@ const docTemplate = `{
},
"/answer/api/v1/plugin/status": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get all plugins status",
"consumes": [
"application/json"
@@ -4391,11 +4356,6 @@ const docTemplate = `{
},
"/answer/api/v1/question/info": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get question details",
"consumes": [
"application/json"
@@ -4429,11 +4389,6 @@ const docTemplate = `{
},
"/answer/api/v1/question/invite": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get question invite user info",
"consumes": [
"application/json"
@@ -5771,6 +5726,11 @@ const docTemplate = `{
}
},
"put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "update tag",
"consumes": [
"application/json"
@@ -5803,6 +5763,11 @@ const docTemplate = `{
}
},
"post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "add tag",
"consumes": [
"application/json"
@@ -5835,6 +5800,11 @@ const docTemplate = `{
}
},
"delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "delete tag",
"consumes": [
"application/json"
@@ -5869,6 +5839,11 @@ const docTemplate = `{
},
"/answer/api/v1/tag/recover": {
"post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "recover delete tag",
"consumes": [
"application/json"
@@ -5903,6 +5878,11 @@ const docTemplate = `{
},
"/answer/api/v1/tag/synonym": {
"put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "update tag",
"consumes": [
"application/json"
@@ -6230,6 +6210,11 @@ const docTemplate = `{
},
"/answer/api/v1/user/email/change/code": {
"post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "send email to the user email then change their email",
"consumes": [
"application/json"
@@ -6310,6 +6295,9 @@ const docTemplate = `{
"/answer/api/v1/user/email/verification/send": {
"post": {
"security": [
+ {
+ "ApiKeyAuth": []
+ },
{
"ApiKeyAuth": []
}
@@ -6578,6 +6566,11 @@ const docTemplate = `{
},
"/answer/api/v1/user/logout": {
"get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "user logout",
"consumes": [
"application/json"
@@ -6945,11 +6938,6 @@ const docTemplate = `{
},
"/answer/api/v1/user/ranking": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get user ranking",
"consumes": [
"application/json"
@@ -7031,11 +7019,6 @@ const docTemplate = `{
},
"/answer/api/v1/user/staff": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get user staff",
"consumes": [
"application/json"
@@ -7049,13 +7032,18 @@ const docTemplate = `{
"summary": "get user staff",
"parameters": [
{
- "description": "GetUserStaffReq",
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/schema.GetUserStaffReq"
- }
+ "type": "string",
+ "description": "username",
+ "name": "username",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "page_size",
+ "name": "page_size",
+ "in": "query",
+ "required": true
}
],
"responses": {
@@ -9422,19 +9410,6 @@ const docTemplate = `{
}
}
},
- "schema.GetUserStaffReq": {
- "type": "object",
- "properties": {
- "page_size": {
- "type": "integer",
- "minimum": 1
- },
- "username": {
- "type": "string",
- "maxLength": 500
- }
- }
- },
"schema.GetUserStaffResp": {
"type": "object",
"properties": {
diff --git a/docs/swagger.json b/docs/swagger.json
index 53b95cb8f..aa35ff90c 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -309,6 +309,11 @@
},
"/answer/admin/api/language/options": {
"get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "Get language options",
"produces": [
"application/json"
@@ -663,6 +668,11 @@
},
"/answer/admin/api/roles": {
"get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "get role list",
"produces": [
"application/json"
@@ -2269,11 +2279,6 @@
},
"/answer/api/v1/answer/page": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "AnswerList \u003cbr\u003e \u003cb\u003eorder\u003c/b\u003e (default or updated)",
"consumes": [
"application/json"
@@ -2366,11 +2371,6 @@
},
"/answer/api/v1/badge": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get badge info",
"consumes": [
"application/json"
@@ -2416,11 +2416,6 @@
},
"/answer/api/v1/badge/awards/page": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get badge award list",
"consumes": [
"application/json"
@@ -2483,11 +2478,6 @@
},
"/answer/api/v1/badge/user/awards": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get user badge award list",
"consumes": [
"application/json"
@@ -2535,11 +2525,6 @@
},
"/answer/api/v1/badge/user/awards/recent": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get user badge award list",
"consumes": [
"application/json"
@@ -2587,11 +2572,6 @@
},
"/answer/api/v1/badges": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "list all badges group by group",
"consumes": [
"application/json"
@@ -3338,11 +3318,6 @@
},
"/answer/api/v1/meta/reaction": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get reaction for an object",
"consumes": [
"application/json"
@@ -3907,11 +3882,6 @@
},
"/answer/api/v1/personal/qa/top": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "UserTop",
"consumes": [
"application/json"
@@ -4130,11 +4100,6 @@
},
"/answer/api/v1/plugin/status": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get all plugins status",
"consumes": [
"application/json"
@@ -4364,11 +4329,6 @@
},
"/answer/api/v1/question/info": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get question details",
"consumes": [
"application/json"
@@ -4402,11 +4362,6 @@
},
"/answer/api/v1/question/invite": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get question invite user info",
"consumes": [
"application/json"
@@ -5744,6 +5699,11 @@
}
},
"put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "update tag",
"consumes": [
"application/json"
@@ -5776,6 +5736,11 @@
}
},
"post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "add tag",
"consumes": [
"application/json"
@@ -5808,6 +5773,11 @@
}
},
"delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "delete tag",
"consumes": [
"application/json"
@@ -5842,6 +5812,11 @@
},
"/answer/api/v1/tag/recover": {
"post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "recover delete tag",
"consumes": [
"application/json"
@@ -5876,6 +5851,11 @@
},
"/answer/api/v1/tag/synonym": {
"put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "update tag",
"consumes": [
"application/json"
@@ -6203,6 +6183,11 @@
},
"/answer/api/v1/user/email/change/code": {
"post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "send email to the user email then change their email",
"consumes": [
"application/json"
@@ -6283,6 +6268,9 @@
"/answer/api/v1/user/email/verification/send": {
"post": {
"security": [
+ {
+ "ApiKeyAuth": []
+ },
{
"ApiKeyAuth": []
}
@@ -6551,6 +6539,11 @@
},
"/answer/api/v1/user/logout": {
"get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
"description": "user logout",
"consumes": [
"application/json"
@@ -6918,11 +6911,6 @@
},
"/answer/api/v1/user/ranking": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get user ranking",
"consumes": [
"application/json"
@@ -7004,11 +6992,6 @@
},
"/answer/api/v1/user/staff": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "get user staff",
"consumes": [
"application/json"
@@ -7022,13 +7005,18 @@
"summary": "get user staff",
"parameters": [
{
- "description": "GetUserStaffReq",
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/schema.GetUserStaffReq"
- }
+ "type": "string",
+ "description": "username",
+ "name": "username",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "page_size",
+ "name": "page_size",
+ "in": "query",
+ "required": true
}
],
"responses": {
@@ -9395,19 +9383,6 @@
}
}
},
- "schema.GetUserStaffReq": {
- "type": "object",
- "properties": {
- "page_size": {
- "type": "integer",
- "minimum": 1
- },
- "username": {
- "type": "string",
- "maxLength": 500
- }
- }
- },
"schema.GetUserStaffResp": {
"type": "object",
"properties": {
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 55b18c5e2..17ccd75be 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1352,15 +1352,6 @@ definitions:
slug_name:
type: string
type: object
- schema.GetUserStaffReq:
- properties:
- page_size:
- minimum: 1
- type: integer
- username:
- maxLength: 500
- type: string
- type: object
schema.GetUserStaffResp:
properties:
avatar:
@@ -3151,6 +3142,8 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
summary: Get language options
tags:
- Lang
@@ -3378,6 +3371,8 @@ paths:
$ref: '#/definitions/schema.GetRoleResp'
type: array
type: object
+ security:
+ - ApiKeyAuth: []
summary: get role list
tags:
- admin
@@ -4344,8 +4339,6 @@ paths:
description: OK
schema:
type: string
- security:
- - ApiKeyAuth: []
summary: AnswerList
tags:
- api-answer
@@ -4397,8 +4390,6 @@ paths:
data:
$ref: '#/definitions/schema.GetBadgeInfoResp'
type: object
- security:
- - ApiKeyAuth: []
summary: get badge info
tags:
- api-badge
@@ -4437,8 +4428,6 @@ paths:
data:
$ref: '#/definitions/schema.GetBadgeInfoResp'
type: object
- security:
- - ApiKeyAuth: []
summary: get badge award list
tags:
- api-badge
@@ -4467,8 +4456,6 @@ paths:
$ref: '#/definitions/schema.GetUserBadgeAwardListResp'
type: array
type: object
- security:
- - ApiKeyAuth: []
summary: get user badge award list
tags:
- api-badge
@@ -4497,8 +4484,6 @@ paths:
$ref: '#/definitions/schema.GetUserBadgeAwardListResp'
type: array
type: object
- security:
- - ApiKeyAuth: []
summary: get user badge award list
tags:
- api-badge
@@ -4521,8 +4506,6 @@ paths:
$ref: '#/definitions/schema.GetBadgeListResp'
type: array
type: object
- security:
- - ApiKeyAuth: []
summary: list all badges group by group
tags:
- api-badge
@@ -4966,8 +4949,6 @@ paths:
data:
$ref: '#/definitions/schema.ReactionRespItem'
type: object
- security:
- - ApiKeyAuth: []
summary: get reaction
tags:
- Meta
@@ -5329,8 +5310,6 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
- security:
- - ApiKeyAuth: []
summary: UserTop
tags:
- Question
@@ -5457,8 +5436,6 @@ paths:
$ref: '#/definitions/schema.GetPluginListResp'
type: array
type: object
- security:
- - ApiKeyAuth: []
summary: get all plugins status
tags:
- Plugin
@@ -5599,8 +5576,6 @@ paths:
description: OK
schema:
type: string
- security:
- - ApiKeyAuth: []
summary: get question details
tags:
- Question
@@ -5623,8 +5598,6 @@ paths:
description: OK
schema:
type: string
- security:
- - ApiKeyAuth: []
summary: get question invite user info
tags:
- Question
@@ -6390,6 +6363,8 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
summary: delete tag
tags:
- Tag
@@ -6441,6 +6416,8 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
summary: add tag
tags:
- Tag
@@ -6462,6 +6439,8 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
summary: update tag
tags:
- Tag
@@ -6484,6 +6463,8 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
summary: recover delete tag
tags:
- Tag
@@ -6506,6 +6487,8 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
summary: update tag
tags:
- Tag
@@ -6700,6 +6683,8 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
summary: send email to the user email then change their email
tags:
- User
@@ -6755,6 +6740,7 @@ paths:
type: string
security:
- ApiKeyAuth: []
+ - ApiKeyAuth: []
summary: UserVerifyEmailSend
tags:
- User
@@ -6905,6 +6891,8 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
summary: user logout
tags:
- User
@@ -7133,8 +7121,6 @@ paths:
data:
$ref: '#/definitions/schema.UserRankingResp'
type: object
- security:
- - ApiKeyAuth: []
summary: get user ranking
tags:
- User
@@ -7171,12 +7157,16 @@ paths:
- application/json
description: get user staff
parameters:
- - description: GetUserStaffReq
- in: body
- name: data
+ - description: username
+ in: query
+ name: username
required: true
- schema:
- $ref: '#/definitions/schema.GetUserStaffReq'
+ type: string
+ - description: page_size
+ in: query
+ name: page_size
+ required: true
+ type: string
produces:
- application/json
responses:
@@ -7189,8 +7179,6 @@ paths:
data:
$ref: '#/definitions/schema.GetUserStaffResp'
type: object
- security:
- - ApiKeyAuth: []
summary: get user staff
tags:
- User
diff --git a/internal/controller/answer_controller.go b/internal/controller/answer_controller.go
index 64df858ba..4504f881c 100644
--- a/internal/controller/answer_controller.go
+++ b/internal/controller/answer_controller.go
@@ -365,7 +365,6 @@ func (ac *AnswerController) Update(ctx *gin.Context) {
// @Summary AnswerList
// @Description AnswerList
order (default or updated)
// @Tags api-answer
-// @Security ApiKeyAuth
// @Accept json
// @Produce json
// @Param question_id query string true "question_id"
diff --git a/internal/controller/badge_controller.go b/internal/controller/badge_controller.go
index 8324a13ef..61197e715 100644
--- a/internal/controller/badge_controller.go
+++ b/internal/controller/badge_controller.go
@@ -49,7 +49,6 @@ func NewBadgeController(
// @Tags api-badge
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
// @Success 200 {object} handler.RespBody{data=[]schema.GetBadgeListResp}
// @Router /answer/api/v1/badges [get]
func (b *BadgeController) GetBadgeList(ctx *gin.Context) {
@@ -64,7 +63,6 @@ func (b *BadgeController) GetBadgeList(ctx *gin.Context) {
// @Tags api-badge
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
// @Param id query string true "id" default(string)
// @Success 200 {object} handler.RespBody{data=schema.GetBadgeInfoResp}
// @Router /answer/api/v1/badge [get]
@@ -83,7 +81,6 @@ func (b *BadgeController) GetBadgeInfo(ctx *gin.Context) {
// @Tags api-badge
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
// @Param page query int false "page"
// @Param page_size query int false "page size"
// @Param badge_id query string true "badge id"
@@ -111,7 +108,6 @@ func (b *BadgeController) GetBadgeAwardList(ctx *gin.Context) {
// @Tags api-badge
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
// @Param username query string true "user name"
// @Success 200 {object} handler.RespBody{data=[]schema.GetUserBadgeAwardListResp}
// @Router /answer/api/v1/badge/user/awards [get]
@@ -136,7 +132,6 @@ func (b *BadgeController) GetAllBadgeAwardListByUsername(ctx *gin.Context) {
// @Tags api-badge
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
// @Param username query string true "user name"
// @Success 200 {object} handler.RespBody{data=[]schema.GetUserBadgeAwardListResp}
// @Router /answer/api/v1/badge/user/awards/recent [get]
diff --git a/internal/controller/lang_controller.go b/internal/controller/lang_controller.go
index 7e5e70fd8..c7c607bdc 100644
--- a/internal/controller/lang_controller.go
+++ b/internal/controller/lang_controller.go
@@ -57,6 +57,7 @@ func (u *LangController) GetLangMapping(ctx *gin.Context) {
// GetAdminLangOptions Get language options
// @Summary Get language options
// @Description Get language options
+// @Security ApiKeyAuth
// @Tags Lang
// @Produce json
// @Success 200 {object} handler.RespBody{}
diff --git a/internal/controller/meta_controller.go b/internal/controller/meta_controller.go
index 2a818dfd7..624daf093 100644
--- a/internal/controller/meta_controller.go
+++ b/internal/controller/meta_controller.go
@@ -68,7 +68,6 @@ func (mc *MetaController) AddOrUpdateReaction(ctx *gin.Context) {
// @Tags Meta
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
// @Param object_id query string true "object_id"
// @Success 200 {object} handler.RespBody{data=schema.ReactionRespItem}
// @Router /answer/api/v1/meta/reaction [get]
diff --git a/internal/controller/question_controller.go b/internal/controller/question_controller.go
index fb97187bf..4b1869fa7 100644
--- a/internal/controller/question_controller.go
+++ b/internal/controller/question_controller.go
@@ -224,7 +224,6 @@ func (qc *QuestionController) ReopenQuestion(ctx *gin.Context) {
// @Summary get question details
// @Description get question details
// @Tags Question
-// @Security ApiKeyAuth
// @Accept json
// @Produce json
// @Param id query string true "Question TagID" default(1)
@@ -279,7 +278,6 @@ func (qc *QuestionController) GetQuestion(ctx *gin.Context) {
// @Summary get question invite user info
// @Description get question invite user info
// @Tags Question
-// @Security ApiKeyAuth
// @Accept json
// @Produce json
// @Param id query string true "Question ID" default(1)
@@ -821,7 +819,6 @@ func (qc *QuestionController) GetSimilarQuestions(ctx *gin.Context) {
// @Tags Question
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
// @Param username query string true "username" default(string)
// @Success 200 {object} handler.RespBody
// @Router /answer/api/v1/personal/qa/top [get]
diff --git a/internal/controller/tag_controller.go b/internal/controller/tag_controller.go
index 9474eede7..1cebf9d44 100644
--- a/internal/controller/tag_controller.go
+++ b/internal/controller/tag_controller.go
@@ -88,6 +88,7 @@ func (tc *TagController) GetTagsBySlugName(ctx *gin.Context) {
// RemoveTag delete tag
// @Summary delete tag
// @Description delete tag
+// @Security ApiKeyAuth
// @Tags Tag
// @Accept json
// @Produce json
@@ -117,6 +118,7 @@ func (tc *TagController) RemoveTag(ctx *gin.Context) {
// AddTag add tag
// @Summary add tag
// @Description add tag
+// @Security ApiKeyAuth
// @Tags Tag
// @Accept json
// @Produce json
@@ -149,6 +151,7 @@ func (tc *TagController) AddTag(ctx *gin.Context) {
// UpdateTag update tag
// @Summary update tag
// @Description update tag
+// @Security ApiKeyAuth
// @Tags Tag
// @Accept json
// @Produce json
@@ -187,6 +190,7 @@ func (tc *TagController) UpdateTag(ctx *gin.Context) {
// RecoverTag recover delete tag
// @Summary recover delete tag
// @Description recover delete tag
+// @Security ApiKeyAuth
// @Tags Tag
// @Accept json
// @Produce json
@@ -320,6 +324,7 @@ func (tc *TagController) GetTagSynonyms(ctx *gin.Context) {
// UpdateTagSynonym update tag
// @Summary update tag
// @Description update tag
+// @Security ApiKeyAuth
// @Tags Tag
// @Accept json
// @Produce json
diff --git a/internal/controller/user_controller.go b/internal/controller/user_controller.go
index d0545b22e..527027857 100644
--- a/internal/controller/user_controller.go
+++ b/internal/controller/user_controller.go
@@ -226,6 +226,7 @@ func (uc *UserController) UseRePassWord(ctx *gin.Context) {
// UserLogout user logout
// @Summary user logout
// @Description user logout
+// @Security ApiKeyAuth
// @Tags User
// @Accept json
// @Produce json
@@ -334,6 +335,7 @@ func (uc *UserController) UserVerifyEmail(ctx *gin.Context) {
// UserVerifyEmailSend godoc
// @Summary UserVerifyEmailSend
// @Description UserVerifyEmailSend
+// @Security ApiKeyAuth
// @Tags User
// @Accept json
// @Produce json
@@ -548,6 +550,7 @@ func (uc *UserController) UpdateUserNotificationConfig(ctx *gin.Context) {
// UserChangeEmailSendCode send email to the user email then change their email
// @Summary send email to the user email then change their email
// @Description send email to the user email then change their email
+// @Security ApiKeyAuth
// @Tags User
// @Accept json
// @Produce json
@@ -636,7 +639,6 @@ func (uc *UserController) UserChangeEmailVerify(ctx *gin.Context) {
// @Tags User
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
// @Success 200 {object} handler.RespBody{data=schema.UserRankingResp}
// @Router /answer/api/v1/user/ranking [get]
func (uc *UserController) UserRanking(ctx *gin.Context) {
@@ -650,8 +652,8 @@ func (uc *UserController) UserRanking(ctx *gin.Context) {
// @Tags User
// @Accept json
// @Produce json
-// @Security ApiKeyAuth
-// @Param data body schema.GetUserStaffReq true "GetUserStaffReq"
+// @Param username query string true "username"
+// @Param page_size query string true "page_size"
// @Success 200 {object} handler.RespBody{data=schema.GetUserStaffResp}
// @Router /answer/api/v1/user/staff [get]
func (uc *UserController) UserStaff(ctx *gin.Context) {
diff --git a/internal/controller_admin/plugin_controller.go b/internal/controller_admin/plugin_controller.go
index 78f327283..5933f8895 100644
--- a/internal/controller_admin/plugin_controller.go
+++ b/internal/controller_admin/plugin_controller.go
@@ -43,7 +43,6 @@ func NewPluginController(pluginCommonService *plugin_common.PluginCommonService)
// @Summary get all plugins status
// @Description get all plugins status
// @Tags Plugin
-// @Security ApiKeyAuth
// @Accept json
// @Produce json
// @Success 200 {object} handler.RespBody{data=[]schema.GetPluginListResp}
diff --git a/internal/controller_admin/role_controller.go b/internal/controller_admin/role_controller.go
index 2692371ae..87484264c 100644
--- a/internal/controller_admin/role_controller.go
+++ b/internal/controller_admin/role_controller.go
@@ -39,6 +39,7 @@ func NewRoleController(roleService *service.RoleService) *RoleController {
// GetRoleList get role list
// @Summary get role list
// @Description get role list
+// @Security ApiKeyAuth
// @Tags admin
// @Produce json
// @Success 200 {object} handler.RespBody{data=[]schema.GetRoleResp}
diff --git a/internal/repo/answer/answer_repo.go b/internal/repo/answer/answer_repo.go
index cdfc58029..c5447befc 100644
--- a/internal/repo/answer/answer_repo.go
+++ b/internal/repo/answer/answer_repo.go
@@ -198,7 +198,7 @@ func (ar *answerRepo) GetAnswerList(ctx context.Context, answer *entity.Answer)
answerList = make([]*entity.Answer, 0)
answer.ID = uid.DeShortID(answer.ID)
answer.QuestionID = uid.DeShortID(answer.QuestionID)
- err = ar.data.DB.Context(ctx).Find(answerList, answer)
+ err = ar.data.DB.Context(ctx).Find(&answerList, answer)
if err != nil {
err = errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
}
@@ -216,7 +216,7 @@ func (ar *answerRepo) GetAnswerPage(ctx context.Context, page, pageSize int, ans
answer.ID = uid.DeShortID(answer.ID)
answer.QuestionID = uid.DeShortID(answer.QuestionID)
answerList = make([]*entity.Answer, 0)
- total, err = pager.Help(page, pageSize, answerList, answer, ar.data.DB.Context(ctx))
+ total, err = pager.Help(page, pageSize, &answerList, answer, ar.data.DB.Context(ctx))
if err != nil {
err = errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
}
diff --git a/internal/repo/collection/collection_repo.go b/internal/repo/collection/collection_repo.go
index 1aecaf473..a3faacdb5 100644
--- a/internal/repo/collection/collection_repo.go
+++ b/internal/repo/collection/collection_repo.go
@@ -108,7 +108,7 @@ func (cr *collectionRepo) GetCollection(ctx context.Context, id int) (collection
// GetCollectionList get collection list all
func (cr *collectionRepo) GetCollectionList(ctx context.Context, collection *entity.Collection) (collectionList []*entity.Collection, err error) {
collectionList = make([]*entity.Collection, 0)
- err = cr.data.DB.Context(ctx).Find(collectionList, collection)
+ err = cr.data.DB.Context(ctx).Find(&collectionList, collection)
err = errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
return
}
diff --git a/internal/repo/question/question_repo.go b/internal/repo/question/question_repo.go
index 978c9ce32..d5501f5e3 100644
--- a/internal/repo/question/question_repo.go
+++ b/internal/repo/question/question_repo.go
@@ -289,7 +289,7 @@ func (qr *questionRepo) FindByID(ctx context.Context, id []string) (questionList
func (qr *questionRepo) GetQuestionList(ctx context.Context, question *entity.Question) (questionList []*entity.Question, err error) {
question.ID = uid.DeShortID(question.ID)
questionList = make([]*entity.Question, 0)
- err = qr.data.DB.Context(ctx).Find(questionList, question)
+ err = qr.data.DB.Context(ctx).Find(&questionList, question)
if err != nil {
return questionList, errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
}
diff --git a/internal/repo/role/power_repo.go b/internal/repo/role/power_repo.go
index 8da7c6638..bbd600e9e 100644
--- a/internal/repo/role/power_repo.go
+++ b/internal/repo/role/power_repo.go
@@ -44,7 +44,7 @@ func NewPowerRepo(data *data.Data) role.PowerRepo {
// GetPowerList get list all
func (pr *powerRepo) GetPowerList(ctx context.Context, power *entity.Power) (powerList []*entity.Power, err error) {
powerList = make([]*entity.Power, 0)
- err = pr.data.DB.Context(ctx).Find(powerList, power)
+ err = pr.data.DB.Context(ctx).Find(&powerList, power)
if err != nil {
err = errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
}
diff --git a/ui/src/pages/Tags/index.tsx b/ui/src/pages/Tags/index.tsx
index e8f682f7f..b3e22fff5 100644
--- a/ui/src/pages/Tags/index.tsx
+++ b/ui/src/pages/Tags/index.tsx
@@ -32,7 +32,7 @@ import { loggedUserInfoStore } from '@/stores';
const sortBtns = ['popular', 'name', 'newest'];
const Tags = () => {
- const [urlSearch] = useSearchParams();
+ const [urlSearch, setUrlSearch] = useSearchParams();
const { t } = useTranslation('translation', { keyPrefix: 'tags' });
const [searchTag, setSearchTag] = useState('');
const { role_id } = loggedUserInfoStore((_) => _.user);
@@ -56,6 +56,10 @@ const Tags = () => {
const handleChange = (e) => {
setSearchTag(e.target.value);
+ setUrlSearch((prev) => {
+ prev.set('page', '1');
+ return prev;
+ });
};
const handleFollow = (tag) => {