Ver código fonte

update

master
shenjiachi 2 semanas atrás
pai
commit
97a57ce29e
5 arquivos alterados com 203 adições e 3 exclusões
  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 Ver arquivo

@@ -298,3 +298,33 @@ func GetSTSVoucher(c *gin.Context) {
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 Ver arquivo

@@ -361,7 +361,8 @@ func rFriendCircleSettings(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 Ver arquivo

@@ -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": {
"post": {
"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": {
"type": "object",
"properties": {


+ 63
- 0
docs/swagger.json Ver arquivo

@@ -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": {
"post": {
"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": {
"type": "object",
"properties": {


+ 43
- 0
docs/swagger.yaml Ver arquivo

@@ -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.
type: string
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:
properties:
bucket:
@@ -5486,6 +5504,31 @@ paths:
summary: 云打包-图片配置
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:
post:
consumes:


Carregando…
Cancelar
Salvar