mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-05 08:13:22 +08:00
@@ -282,6 +282,42 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/admin/profile": {
|
||||
"get": {
|
||||
"description": "管理员信息",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Admin"
|
||||
],
|
||||
"summary": "管理员信息",
|
||||
"operationId": "admin-profile",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/web.Resp"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/domain.AdminUser"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/admin/setting": {
|
||||
"get": {
|
||||
"description": "获取系统设置",
|
||||
|
||||
@@ -76,6 +76,7 @@ func NewUserHandler(
|
||||
admin.GET("/setting", web.BaseHandler(u.GetSetting))
|
||||
|
||||
admin.Use(auth.Auth(), active.Active("admin"))
|
||||
admin.GET("/profile", web.BaseHandler(u.AdminProfile))
|
||||
admin.GET("/list", web.BaseHandler(u.AdminList, web.WithPage()))
|
||||
admin.GET("/login-history", web.BaseHandler(u.AdminLoginHistory, web.WithPage()))
|
||||
admin.PUT("/setting", web.BindHandler(u.UpdateSetting))
|
||||
@@ -354,6 +355,21 @@ func (h *UserHandler) AdminLogout(c *web.Context) error {
|
||||
return c.Success(nil)
|
||||
}
|
||||
|
||||
// AdminProfile 管理员信息
|
||||
//
|
||||
// @Tags Admin
|
||||
// @Summary 管理员信息
|
||||
// @Description 管理员信息
|
||||
// @ID admin-profile
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} web.Resp{data=domain.AdminUser}
|
||||
// @Router /api/v1/admin/profile [get]
|
||||
func (h *UserHandler) AdminProfile(c *web.Context) error {
|
||||
user := middleware.GetAdmin(c)
|
||||
return c.Success(user)
|
||||
}
|
||||
|
||||
// List 获取用户列表
|
||||
//
|
||||
// @Tags User
|
||||
|
||||
Reference in New Issue
Block a user