Documentation ¶
Index ¶
- func Inject(container *dig.Container) error
- 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) QueryUserPermissionTree(c *gin.Context)
- func (a *Login) RefreshToken(c *gin.Context)
- func (a *Login) ResCaptcha(c *gin.Context)
- func (a *Login) UpdatePassword(c *gin.Context)
- type Permission
- type Role
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Login ¶
type Login struct {
LoginBll controllers.ILogin
}
Login - Manage Login
func NewLogin ¶
func NewLogin(bLogin controllers.ILogin) *Login
NewLogin - Create login manage controller
func (*Login) GetCaptcha ¶
GetCaptcha - Get verification code information @Tags Manage Login @Summary Get verification code information @Success 200 {object} schema.LoginCaptcha @Router /api/v1/pub/login/captchaid [get]
func (*Login) GetUserInfo ¶
GetUserInfo - Get current user information @Tags Manage Login @Summary Get current user information @Param Authorization header string false "Bearer User Token" @Success 200 {object} schema.UserLoginInfo @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/current/user [get]
func (*Login) Login ¶
Login - User login @Tags Manage Login @Summary User login @Param body body schema.LoginParam true "Request parameter" @Success 200 {object} schema.LoginTokenInfo @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/login [post]
func (*Login) Logout ¶
Logout - User logout @Tags Manage Login @Summary User logout @Success 200 {object} schema.HTTPStatus "{status: OK}" @Router /api/v1/pub/login/exit [post]
func (*Login) QueryUserPermissionTree ¶
QueryUserPermissionTree - Query current user permission tree @Tags Manage Login @Summary Query current user permission tree @Param Authorization header string false "Bearer User Token" @Success 200 {object} schema.Permission "Search result: {list:Permission tree}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/current/permissiontree [get]
func (*Login) RefreshToken ¶
RefreshToken - Refresh token @Tags Manage Login @Summary Refresh token @Param Authorization header string false "Bearer User Token" @Success 200 {object} schema.LoginTokenInfo @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/refresh-token [post]
func (*Login) ResCaptcha ¶
ResCaptcha - Response graphic verification code @Tags Manage Login @Summary Response graphic verification code @Param id query string true "Verification code ID" @Param reload query string false "Reload" @Produce image/png @Success 200 "Captcha" @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/login/captcha [get]
func (*Login) UpdatePassword ¶
UpdatePassword - Update personal password @Tags Manage Login @Summary Update personal password @Param Authorization header string false "Bearer User Token" @Param body body schema.UpdatePasswordParam true "Request parameter" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/current/password [put]
type Permission ¶
type Permission struct {
PermissionBll controllers.IPermission
}
Permission - Manage Permission
func NewPermission ¶
func NewPermission(bPermission controllers.IPermission) *Permission
NewPermission - Create a Permission management controller
func (*Permission) Create ¶
func (a *Permission) Create(c *gin.Context)
Create - Create data @Tags Manage Permission @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.Permission true "Create data" @Success 200 {object} schema.Permission @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/permissions [post]
func (*Permission) Delete ¶
func (a *Permission) Delete(c *gin.Context)
Delete - Delete data @Tags Manage Permission @Summary Delete data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/permissions/{id} [delete]
func (*Permission) Get ¶
func (a *Permission) Get(c *gin.Context)
Get - Query specified data @Tags Manage Permission @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.Permission @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 404 {object} schema.HTTPError "{error:{code:0,message:Resource does not exist.}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/permissions/{id} [get]
func (*Permission) Query ¶
func (a *Permission) Query(c *gin.Context)
Query - Query data @Tags Manage Permission @Summary Query data @Param Authorization header string false "Bearer User Token" @Param current query int true "Paging index" default(1) @Param pageSize query int true "Paging Size" default(10) @Param name query string false "Name" @Param hidden query int false "Hide permission (0: don't hide 1: hide)" @Param parentID query string false "Parent ID" @Success 200 {array} schema.Permission "Search result: {list:List data,pagination:{current:Page index,pageSize:Page size,total:total number}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/permissions [get]
func (*Permission) QueryTree ¶
func (a *Permission) QueryTree(c *gin.Context)
QueryTree - Query permission tree @Tags Manage Permission @Summary Query permission tree @Param Authorization header string false "Bearer User Token" @Param includeActions query int false "Whether to include action data (1 is)" @Param includeResources query int false "Whether to include resource data (1 is)" @Success 200 {array} schema.PermissionTree "Search result: {list: List data}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/permissions.tree [get]
func (*Permission) Update ¶
func (a *Permission) Update(c *gin.Context)
Update - Update data @Tags Manage Permission @Summary Update data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Param body body schema.Permission true "Update data" @Success 200 {object} schema.Permission @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/permissions/{id} [put]
type Role ¶
type Role struct {
RoleBll controllers.IRole
}
Role - Manage Role
func NewRole ¶
func NewRole(bRole controllers.IRole) *Role
NewRole - Create Role management controller
func (*Role) Create ¶
Create - Create data @Tags Manage Role @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.Role true "Create data" @Success 200 {object} schema.Role @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/roles [post]
func (*Role) Delete ¶
Delete - Delete data @Tags Manage Role @Summary Delete data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/roles/{id} [delete]
func (*Role) Get ¶
Get - Query specified data @Tags Manage Role @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.Role @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 404 {object} schema.HTTPError "{error:{code:0,message:Resource does not exist.}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/roles/{id} [get]
func (*Role) Query ¶
Query - Query data @Tags Manage Role @Summary Query data @Param Authorization header string false "Bearer User Token" @Param current query int true "Paging index" default(1) @Param pageSize query int true "Paging Size" default(10) @Param name query string false "Role name (fuzzy query)" @Success 200 {array} schema.Role "Search result: {list:List data,pagination:{current:Page index,pageSize:Page size,total:Total number}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/roles [get]
func (*Role) QuerySelect ¶
QuerySelect - Query selection data @Tags Manage Role @Summary Query selection data @Param Authorization header string false "Bearer User Token" @Success 200 {array} schema.Role "Search result: {list: Role list}" @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Unknown query type}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/roles.select [get]
func (*Role) Update ¶
Update - Update data @Tags Manage Role @Summary Update data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Param body body schema.Role true "Update data" @Success 200 {object} schema.Role @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/roles/{id} [put]
type User ¶
type User struct {
UserBll controllers.IUser
}
User - Manage Users
func NewUser ¶
func NewUser(bUser controllers.IUser) *User
NewUser - Create a User Management Controller
func (*User) Create ¶
Create - Create data @Tags Manage Users @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.User true "Create data" @Success 200 {object} schema.User @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/users [post]
func (*User) Delete ¶
Delete - Delete data @Tags Manage Users @Summary Delete data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/users/{id} [delete]
func (*User) Disable ¶
Disable - Disable data @Tags Manage Users @Summary Disable data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/users/{id}/disable [patch]
func (*User) Enable ¶
Enable - Enable data @Tags Manage Users @Summary Enable data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/users/{id}/enable [patch]
func (*User) Get ¶
Get - Query specified data @Tags Manage Users @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.User @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 404 {object} schema.HTTPError "{error:{code:0,message: Resource does not exist.}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/users/{id} [get]
func (*User) Query ¶
Query - Query data @Tags Manage Users @Summary Query data @Param Authorization header string false "Bearer User Token" @Param current query int true "Paging index" default(1) @Param pageSize query int true "Paging Size" default(10) @Param userName query string false "Username (fuzzy query)" @Param realName query string false "Real name (fuzzy query)" @Param roleIDs query string false "Role ID (multiple separated by commas)" @Param status query int false "Status (1: Enable 2: Disable)" @Success 200 {array} schema.UserShow "Search result: {list:List data,pagination:{current:Page index,pageSize:Page size,total:Total number}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/users [get]
func (*User) Update ¶
Update - Update data @Tags Manage Users @Summary Update data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Param body body schema.User true "Update data" @Success 200 {object} schema.User @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/users/{id} [put]