Browse Source

fix: 修改登录接口文档 (#2334)

pull/2337/head
ssongliu 1 year ago committed by GitHub
parent
commit
879d640793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      backend/app/api/v1/auth.go
  2. 13
      cmd/server/docs/docs.go
  3. 13
      cmd/server/docs/swagger.json
  4. 9
      cmd/server/docs/swagger.yaml

2
backend/app/api/v1/auth.go

@ -19,10 +19,10 @@ type BaseApi struct{}
// @Summary User login
// @Description 用户登录
// @Accept json
// @Param EntranceCode header string true "安全入口 base64 加密串"
// @Param request body dto.Login true "request"
// @Success 200 {object} dto.UserLoginInfo
// @Router /auth/login [post]
// @Header 200 {string} EntranceCode "安全入口"
func (b *BaseApi) Login(c *gin.Context) {
var req dto.Login
if err := c.ShouldBindJSON(&req); err != nil {

13
cmd/server/docs/docs.go

@ -943,6 +943,13 @@ const docTemplate = `{
],
"summary": "User login",
"parameters": [
{
"type": "string",
"description": "安全入口 base64 加密串",
"name": "EntranceCode",
"in": "header",
"required": true
},
{
"description": "request",
"name": "request",
@ -958,12 +965,6 @@ const docTemplate = `{
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.UserLoginInfo"
},
"headers": {
"EntranceCode": {
"type": "string",
"description": "安全入口"
}
}
}
}

13
cmd/server/docs/swagger.json

@ -936,6 +936,13 @@
],
"summary": "User login",
"parameters": [
{
"type": "string",
"description": "安全入口 base64 加密串",
"name": "EntranceCode",
"in": "header",
"required": true
},
{
"description": "request",
"name": "request",
@ -951,12 +958,6 @@
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.UserLoginInfo"
},
"headers": {
"EntranceCode": {
"type": "string",
"description": "安全入口"
}
}
}
}

9
cmd/server/docs/swagger.yaml

@ -4638,6 +4638,11 @@ paths:
- application/json
description: 用户登录
parameters:
- description: 安全入口 base64 加密串
in: header
name: EntranceCode
required: true
type: string
- description: request
in: body
name: request
@ -4647,10 +4652,6 @@ paths:
responses:
"200":
description: OK
headers:
EntranceCode:
description: 安全入口
type: string
schema:
$ref: '#/definitions/dto.UserLoginInfo'
summary: User login

Loading…
Cancel
Save