Browse Source

update

master
shenjiachi 2 weeks ago
parent
commit
97a57ce29e
5 changed files with 203 additions and 3 deletions
  1. +30
    -0
      app/hdl/comm/hdl_comm.go
  2. +4
    -3
      app/router/router.go
  3. +63
    -0
      docs/docs.go
  4. +63
    -0
      docs/swagger.json
  5. +43
    -0
      docs/swagger.yaml

+ 30
- 0
app/hdl/comm/hdl_comm.go View File

@@ -298,3 +298,33 @@ func GetSTSVoucher(c *gin.Context) {
return return


} }

type GetAdminInfoResp struct {
AdmId int `json:"adm_id"` // 管理员id
Username string `json:"username"` // 用户名
State int `json:"state"` // 状态(1:正常 2:冻结)
IsSuperAdministrator int `json:"is_super_administrator"` // 是否为超级管理员(0:否 1:是)
Memo string `json:"memo"` // 备注信息
}

// GetAdminInfo
// @Summary 通用请求-获取管理员信息
// @Tags 通用请求
// @Description 获取管理员信息
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} GetAdminInfoResp "管理员信息"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/comm/adminInfo [POST]
func GetAdminInfo(c *gin.Context) {
admin := svc.GetUser(c)
resp := GetAdminInfoResp{
AdmId: admin.AdmId,
Username: admin.Username,
State: admin.State,
IsSuperAdministrator: admin.IsSuperAdministrator,
Memo: admin.Memo,
}
e.OutSuc(c, resp, nil)
}

+ 4
- 3
app/router/router.go View File

@@ -361,7 +361,8 @@ func rFriendCircleSettings(r *gin.RouterGroup) {
} }


func rComm(r *gin.RouterGroup) { func rComm(r *gin.RouterGroup) {
r.POST("/getMenuList", comm.MenuList) // 获取菜单栏列表
r.POST("/getOssUrl", comm.GetOssUrl) // 获取阿里云上传PutObject所需的签名URL
r.GET("/getSTSVoucher", comm.GetSTSVoucher)
r.POST("/getMenuList", comm.MenuList) // 获取菜单栏列表
r.POST("/getOssUrl", comm.GetOssUrl) // 获取阿里云上传PutObject所需的签名URL
r.GET("/getSTSVoucher", comm.GetSTSVoucher) // 获取 STS 凭证
r.GET("/adminInfo", comm.GetAdminInfo)
} }

+ 63
- 0
docs/docs.go View File

@@ -1295,6 +1295,44 @@ const docTemplate = `{
} }
} }
}, },
"/api/comm/adminInfo": {
"post": {
"description": "获取管理员信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"通用请求"
],
"summary": "通用请求-获取管理员信息",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "管理员信息",
"schema": {
"$ref": "#/definitions/comm.GetAdminInfoResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/comm/getOssUrl": { "/api/comm/getOssUrl": {
"post": { "post": {
"description": "上传许可链接(获取)", "description": "上传许可链接(获取)",
@@ -7402,6 +7440,31 @@ const docTemplate = `{
} }
} }
}, },
"comm.GetAdminInfoResp": {
"type": "object",
"properties": {
"adm_id": {
"description": "管理员id",
"type": "integer"
},
"is_super_administrator": {
"description": "是否为超级管理员(0:否 1:是)",
"type": "integer"
},
"memo": {
"description": "备注信息",
"type": "string"
},
"state": {
"description": "状态(1:正常 2:冻结)",
"type": "integer"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"comm.GetSTSVoucherResp": { "comm.GetSTSVoucherResp": {
"type": "object", "type": "object",
"properties": { "properties": {


+ 63
- 0
docs/swagger.json View File

@@ -1288,6 +1288,44 @@
} }
} }
}, },
"/api/comm/adminInfo": {
"post": {
"description": "获取管理员信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"通用请求"
],
"summary": "通用请求-获取管理员信息",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "管理员信息",
"schema": {
"$ref": "#/definitions/comm.GetAdminInfoResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/comm/getOssUrl": { "/api/comm/getOssUrl": {
"post": { "post": {
"description": "上传许可链接(获取)", "description": "上传许可链接(获取)",
@@ -7395,6 +7433,31 @@
} }
} }
}, },
"comm.GetAdminInfoResp": {
"type": "object",
"properties": {
"adm_id": {
"description": "管理员id",
"type": "integer"
},
"is_super_administrator": {
"description": "是否为超级管理员(0:否 1:是)",
"type": "integer"
},
"memo": {
"description": "备注信息",
"type": "string"
},
"state": {
"description": "状态(1:正常 2:冻结)",
"type": "integer"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"comm.GetSTSVoucherResp": { "comm.GetSTSVoucherResp": {
"type": "object", "type": "object",
"properties": { "properties": {


+ 43
- 0
docs/swagger.yaml View File

@@ -259,6 +259,24 @@ definitions:
> Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens. > Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens.
type: string type: string
type: object type: object
comm.GetAdminInfoResp:
properties:
adm_id:
description: 管理员id
type: integer
is_super_administrator:
description: 是否为超级管理员(0:否 1:是)
type: integer
memo:
description: 备注信息
type: string
state:
description: 状态(1:正常 2:冻结)
type: integer
username:
description: 用户名
type: string
type: object
comm.GetSTSVoucherResp: comm.GetSTSVoucherResp:
properties: properties:
bucket: bucket:
@@ -5486,6 +5504,31 @@ paths:
summary: 云打包-图片配置 summary: 云打包-图片配置
tags: tags:
- 云打包 - 云打包
/api/comm/adminInfo:
post:
consumes:
- application/json
description: 获取管理员信息
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: 管理员信息
schema:
$ref: '#/definitions/comm.GetAdminInfoResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 通用请求-获取管理员信息
tags:
- 通用请求
/api/comm/getOssUrl: /api/comm/getOssUrl:
post: post:
consumes: consumes:


Loading…
Cancel
Save