update swagger

This commit is contained in:
aichy126 2022-10-28 15:46:05 +08:00
parent 5ecac4dda3
commit 8fb4474052
4 changed files with 267 additions and 4 deletions

View File

@ -3326,7 +3326,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/schema.GetUserResp"
"$ref": "#/definitions/schema.GetUserToSetShowResp"
}
}
}
@ -4853,6 +4853,102 @@ const docTemplate = `{
}
}
},
"schema.GetUserToSetShowResp": {
"type": "object",
"properties": {
"access_token": {
"description": "access token",
"type": "string"
},
"answer_count": {
"description": "answer count",
"type": "integer"
},
"authority_group": {
"description": "authority group",
"type": "integer"
},
"avatar": {
"$ref": "#/definitions/schema.AvatarInfo"
},
"bio": {
"description": "bio markdown",
"type": "string"
},
"bio_html": {
"description": "bio html",
"type": "string"
},
"created_at": {
"description": "create time",
"type": "integer"
},
"display_name": {
"description": "display name",
"type": "string"
},
"e_mail": {
"description": "email",
"type": "string"
},
"follow_count": {
"description": "follow count",
"type": "integer"
},
"id": {
"description": "user id",
"type": "string"
},
"ip_info": {
"description": "ip info",
"type": "string"
},
"is_admin": {
"description": "is admin",
"type": "boolean"
},
"last_login_date": {
"description": "last login date",
"type": "integer"
},
"location": {
"description": "location",
"type": "string"
},
"mail_status": {
"description": "mail status(1 pass 2 to be verified)",
"type": "integer"
},
"mobile": {
"description": "mobile",
"type": "string"
},
"notice_status": {
"description": "notice status(1 on 2off)",
"type": "integer"
},
"question_count": {
"description": "question count",
"type": "integer"
},
"rank": {
"description": "rank",
"type": "integer"
},
"status": {
"description": "user status",
"type": "string"
},
"username": {
"description": "username",
"type": "string"
},
"website": {
"description": "website",
"type": "string"
}
}
},
"schema.GetVoteWithPageResp": {
"type": "object",
"properties": {

View File

@ -3314,7 +3314,7 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/schema.GetUserResp"
"$ref": "#/definitions/schema.GetUserToSetShowResp"
}
}
}
@ -4841,6 +4841,102 @@
}
}
},
"schema.GetUserToSetShowResp": {
"type": "object",
"properties": {
"access_token": {
"description": "access token",
"type": "string"
},
"answer_count": {
"description": "answer count",
"type": "integer"
},
"authority_group": {
"description": "authority group",
"type": "integer"
},
"avatar": {
"$ref": "#/definitions/schema.AvatarInfo"
},
"bio": {
"description": "bio markdown",
"type": "string"
},
"bio_html": {
"description": "bio html",
"type": "string"
},
"created_at": {
"description": "create time",
"type": "integer"
},
"display_name": {
"description": "display name",
"type": "string"
},
"e_mail": {
"description": "email",
"type": "string"
},
"follow_count": {
"description": "follow count",
"type": "integer"
},
"id": {
"description": "user id",
"type": "string"
},
"ip_info": {
"description": "ip info",
"type": "string"
},
"is_admin": {
"description": "is admin",
"type": "boolean"
},
"last_login_date": {
"description": "last login date",
"type": "integer"
},
"location": {
"description": "location",
"type": "string"
},
"mail_status": {
"description": "mail status(1 pass 2 to be verified)",
"type": "integer"
},
"mobile": {
"description": "mobile",
"type": "string"
},
"notice_status": {
"description": "notice status(1 on 2off)",
"type": "integer"
},
"question_count": {
"description": "question count",
"type": "integer"
},
"rank": {
"description": "rank",
"type": "integer"
},
"status": {
"description": "user status",
"type": "string"
},
"username": {
"description": "username",
"type": "string"
},
"website": {
"description": "website",
"type": "string"
}
}
},
"schema.GetVoteWithPageResp": {
"type": "object",
"properties": {

View File

@ -683,6 +683,77 @@ definitions:
description: website
type: string
type: object
schema.GetUserToSetShowResp:
properties:
access_token:
description: access token
type: string
answer_count:
description: answer count
type: integer
authority_group:
description: authority group
type: integer
avatar:
$ref: '#/definitions/schema.AvatarInfo'
bio:
description: bio markdown
type: string
bio_html:
description: bio html
type: string
created_at:
description: create time
type: integer
display_name:
description: display name
type: string
e_mail:
description: email
type: string
follow_count:
description: follow count
type: integer
id:
description: user id
type: string
ip_info:
description: ip info
type: string
is_admin:
description: is admin
type: boolean
last_login_date:
description: last login date
type: integer
location:
description: location
type: string
mail_status:
description: mail status(1 pass 2 to be verified)
type: integer
mobile:
description: mobile
type: string
notice_status:
description: notice status(1 on 2off)
type: integer
question_count:
description: question count
type: integer
rank:
description: rank
type: integer
status:
description: user status
type: string
username:
description: username
type: string
website:
description: website
type: string
type: object
schema.GetVoteWithPageResp:
properties:
answer_id:
@ -3305,7 +3376,7 @@ paths:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetUserResp'
$ref: '#/definitions/schema.GetUserToSetShowResp'
type: object
security:
- ApiKeyAuth: []

View File

@ -52,7 +52,7 @@ func NewUserController(
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Success 200 {object} handler.RespBody{data=schema.GetUserResp}
// @Success 200 {object} handler.RespBody{data=schema.GetUserToSetShowResp}
// @Router /answer/api/v1/user/info [get]
func (uc *UserController) GetUserInfoByUserID(ctx *gin.Context) {
userID := middleware.GetLoginUserIDFromContext(ctx)