瀏覽代碼

update

master
dengbiao 2 月之前
父節點
當前提交
9a691553df
共有 5 個檔案被更改,包括 85 行新增7 行删除
  1. +8
    -3
      app/hdl/hdl_login.go
  2. +1
    -1
      app/md/md_login.go
  3. +28
    -1
      docs/docs.go
  4. +28
    -1
      docs/swagger.json
  5. +20
    -1
      docs/swagger.yaml

+ 8
- 3
app/hdl/hdl_login.go 查看文件

@@ -66,13 +66,18 @@ func Login(c *gin.Context) {
// @Accept json
// @Produce json
// @Param req body md.LoginReq true "用户名密码"
// @Success 200 {object} md.LoginResponse "token"
// @Success 200 {object} md.LoginInfoResponse "token"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/loginInfo [GET]
func LoginInfo(c *gin.Context) {
admin := svc.GetUser(c)
e.OutSuc(c, md.LoginResponse{
Token: token,
e.OutSuc(c, md.LoginInfoResponse{
AdmId: admin.AdmId,
Username: admin.Username,
IsSuperAdministrator: admin.IsSuperAdministrator,
Memo: admin.Memo,
CreateAt: admin.CreateAt,
UpdateAt: admin.UpdateAt,
}, nil)
return
}

+ 1
- 1
app/md/md_login.go 查看文件

@@ -13,7 +13,7 @@ type LoginResponse struct {
type LoginInfoResponse struct {
AdmId int `json:"adm_id" ` // 管理员id
Username string `json:"username" example:"登录账号"`
IsSuperAdministrator int `json:"is_super_administrator" example:"是否为超级管理员(0:否 1:是)"`
IsSuperAdministrator int `json:"is_super_administrator"` // 是否为超级管理员(0:否 1:是)
Memo string `json:"memo" example:"备注信息"`
CreateAt string `json:"create_at" `
UpdateAt string `json:"update_at" `


+ 28
- 1
docs/docs.go 查看文件

@@ -234,7 +234,7 @@ const docTemplate = `{
"200": {
"description": "token",
"schema": {
"$ref": "#/definitions/md.LoginResponse"
"$ref": "#/definitions/md.LoginInfoResponse"
}
},
"400": {
@@ -1384,6 +1384,33 @@ const docTemplate = `{
}
}
},
"md.LoginInfoResponse": {
"type": "object",
"properties": {
"adm_id": {
"description": "管理员id",
"type": "integer"
},
"create_at": {
"type": "string"
},
"is_super_administrator": {
"description": "是否为超级管理员(0:否 1:是)",
"type": "integer"
},
"memo": {
"type": "string",
"example": "备注信息"
},
"update_at": {
"type": "string"
},
"username": {
"type": "string",
"example": "登录账号"
}
}
},
"md.LoginReq": {
"type": "object",
"required": [


+ 28
- 1
docs/swagger.json 查看文件

@@ -226,7 +226,7 @@
"200": {
"description": "token",
"schema": {
"$ref": "#/definitions/md.LoginResponse"
"$ref": "#/definitions/md.LoginInfoResponse"
}
},
"400": {
@@ -1376,6 +1376,33 @@
}
}
},
"md.LoginInfoResponse": {
"type": "object",
"properties": {
"adm_id": {
"description": "管理员id",
"type": "integer"
},
"create_at": {
"type": "string"
},
"is_super_administrator": {
"description": "是否为超级管理员(0:否 1:是)",
"type": "integer"
},
"memo": {
"type": "string",
"example": "备注信息"
},
"update_at": {
"type": "string"
},
"username": {
"type": "string",
"example": "登录账号"
}
}
},
"md.LoginReq": {
"type": "object",
"required": [


+ 20
- 1
docs/swagger.yaml 查看文件

@@ -282,6 +282,25 @@ definitions:
total:
type: integer
type: object
md.LoginInfoResponse:
properties:
adm_id:
description: 管理员id
type: integer
create_at:
type: string
is_super_administrator:
description: 是否为超级管理员(0:否 1:是)
type: integer
memo:
example: 备注信息
type: string
update_at:
type: string
username:
example: 登录账号
type: string
type: object
md.LoginReq:
properties:
code:
@@ -599,7 +618,7 @@ paths:
"200":
description: token
schema:
$ref: '#/definitions/md.LoginResponse'
$ref: '#/definitions/md.LoginInfoResponse'
"400":
description: 具体错误
schema:


Loading…
取消
儲存