@@ -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) | |||
} |
@@ -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) | |||
} |
@@ -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": { | |||
@@ -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": { | |||
@@ -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: | |||