Documentation ¶
Index ¶
- type Login
- func (a *Login) GetCaptcha(c *gin.Context)
- func (a *Login) GetUserInfo(c *gin.Context)
- func (a *Login) Login(c *gin.Context)
- func (a *Login) Logout(c *gin.Context)
- func (a *Login) QueryMenus(c *gin.Context)
- func (a *Login) RefreshToken(c *gin.Context)
- func (a *Login) ResponseCaptcha(c *gin.Context)
- func (a *Login) UpdatePassword(c *gin.Context)
- func (a *Login) UpdateUser(c *gin.Context)
- type Menu
- type Role
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Login ¶
func (*Login) GetCaptcha ¶
@Tags LoginAPI @Summary Get captcha ID @Success 200 {object} util.ResponseResult{data=schema.Captcha} @Router /api/v1/captcha/id [get]
func (*Login) GetUserInfo ¶
@Tags LoginAPI @Security ApiKeyAuth @Summary Get current user info @Success 200 {object} util.ResponseResult{data=schema.User} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/user [get]
func (*Login) Login ¶
@Tags LoginAPI @Summary Login system with username and password @Param body body schema.LoginForm true "Request body" @Success 200 {object} util.ResponseResult{data=schema.LoginToken} @Failure 400 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/login [post]
func (*Login) Logout ¶
@Tags LoginAPI @Security ApiKeyAuth @Summary Logout system @Success 200 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/logout [post]
func (*Login) QueryMenus ¶
@Tags LoginAPI @Security ApiKeyAuth @Summary Query current user menus based on the current user role @Success 200 {object} util.ResponseResult{data=[]schema.Menu} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/menus [get]
func (*Login) RefreshToken ¶
@Tags LoginAPI @Security ApiKeyAuth @Summary Refresh current access token @Success 200 {object} util.ResponseResult{data=schema.LoginToken} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/refresh-token [post]
func (*Login) ResponseCaptcha ¶
@Tags LoginAPI @Summary Response captcha image @Param id query string true "Captcha ID" @Param reload query number false "Reload captcha image (reload=1)" @Produce image/png @Success 200 "Captcha image" @Failure 404 {object} util.ResponseResult @Router /api/v1/captcha/image [get]
func (*Login) UpdatePassword ¶
@Tags LoginAPI @Security ApiKeyAuth @Summary Change current user password @Param body body schema.UpdateLoginPassword true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/password [put]
func (*Login) UpdateUser ¶
@Tags LoginAPI @Security ApiKeyAuth @Summary Update current user info @Param body body schema.UpdateCurrentUser true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/user [put]
type Menu ¶
Menu management for RBAC
func (*Menu) Create ¶
@Tags MenuAPI @Security ApiKeyAuth @Summary Create menu record @Param body body schema.MenuForm true "Request body" @Success 200 {object} util.ResponseResult{data=schema.Menu} @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus [post]
func (*Menu) Delete ¶
@Tags MenuAPI @Security ApiKeyAuth @Summary Delete menu record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus/{id} [delete]
func (*Menu) Get ¶
@Tags MenuAPI @Security ApiKeyAuth @Summary Get menu record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult{data=schema.Menu} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus/{id} [get]
func (*Menu) Query ¶
@Tags MenuAPI @Security ApiKeyAuth @Summary Query menu tree data @Param code query string false "Code path of menu (like xxx.xxx.xxx)" @Param name query string false "Name of menu" @Param includeResources query bool false "Whether to include menu resources" @Success 200 {object} util.ResponseResult{data=[]schema.Menu} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus [get]
func (*Menu) Update ¶
@Tags MenuAPI @Security ApiKeyAuth @Summary Update menu record by ID @Param id path string true "unique id" @Param body body schema.MenuForm true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus/{id} [put]
type Role ¶
Role management for RBAC
func (*Role) Create ¶
@Tags RoleAPI @Security ApiKeyAuth @Summary Create role record @Param body body schema.RoleForm true "Request body" @Success 200 {object} util.ResponseResult{data=schema.Role} @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles [post]
func (*Role) Delete ¶
@Tags RoleAPI @Security ApiKeyAuth @Summary Delete role record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles/{id} [delete]
func (*Role) Get ¶
@Tags RoleAPI @Security ApiKeyAuth @Summary Get role record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult{data=schema.Role} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles/{id} [get]
func (*Role) Query ¶
@Tags RoleAPI @Security ApiKeyAuth @Summary Query role list @Param current query int true "pagination index" default(1) @Param pageSize query int true "pagination size" default(10) @Param name query string false "Display name of role" @Param status query string false "Status of role (disabled, enabled)" @Success 200 {object} util.ResponseResult{data=[]schema.Role} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles [get]
func (*Role) Update ¶
@Tags RoleAPI @Security ApiKeyAuth @Summary Update role record by ID @Param id path string true "unique id" @Param body body schema.RoleForm true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles/{id} [put]
type User ¶
User management for RBAC
func (*User) Create ¶
@Tags UserAPI @Security ApiKeyAuth @Summary Create user record @Param body body schema.UserForm true "Request body" @Success 200 {object} util.ResponseResult{data=schema.User} @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users [post]
func (*User) Delete ¶
@Tags UserAPI @Security ApiKeyAuth @Summary Delete user record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users/{id} [delete]
func (*User) Get ¶
@Tags UserAPI @Security ApiKeyAuth @Summary Get user record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult{data=schema.User} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users/{id} [get]
func (*User) Query ¶
@Tags UserAPI @Security ApiKeyAuth @Summary Query user list @Param current query int true "pagination index" default(1) @Param pageSize query int true "pagination size" default(10) @Param username query string false "Username for login" @Param name query string false "Name of user" @Param status query string false "Status of user (activated, freezed)" @Success 200 {object} util.ResponseResult{data=[]schema.User} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users [get]
func (*User) ResetPassword ¶
@Tags UserAPI @Security ApiKeyAuth @Summary Reset user password by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users/{id}/reset-pwd [patch]
func (*User) Update ¶
@Tags UserAPI @Security ApiKeyAuth @Summary Update user record by ID @Param id path string true "unique id" @Param body body schema.UserForm true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users/{id} [put]