Documentation ¶
Index ¶
- type Login
- func (a *Login) GetCaptcha(ctx context.Context) (*schema.Captcha, error)
- func (a *Login) GetUserInfo(ctx context.Context) (*schema.User, error)
- func (a *Login) Login(ctx context.Context, formItem *schema.LoginForm) (*schema.LoginToken, error)
- func (a *Login) Logout(ctx context.Context) error
- func (a *Login) ParseUserID(c *gin.Context) (string, error)
- func (a *Login) QueryMenus(ctx context.Context) (schema.Menus, error)
- func (a *Login) RefreshToken(ctx context.Context) (*schema.LoginToken, error)
- func (a *Login) ResponseCaptcha(ctx context.Context, w http.ResponseWriter, id string, reload bool) error
- func (a *Login) UpdatePassword(ctx context.Context, updateItem *schema.UpdateLoginPassword) error
- func (a *Login) UpdateUser(ctx context.Context, updateItem *schema.UpdateCurrentUser) error
- type Menu
- func (a *Menu) Create(ctx context.Context, formItem *schema.MenuForm) (*schema.Menu, error)
- func (a *Menu) Delete(ctx context.Context, id string) error
- func (a *Menu) Get(ctx context.Context, id string) (*schema.Menu, error)
- func (a *Menu) InitFromFile(ctx context.Context, menuFile string) error
- func (a *Menu) Query(ctx context.Context, params schema.MenuQueryParam) (*schema.MenuQueryResult, error)
- func (a *Menu) Update(ctx context.Context, id string, formItem *schema.MenuForm) error
- type Role
- func (a *Role) Create(ctx context.Context, formItem *schema.RoleForm) (*schema.Role, error)
- func (a *Role) Delete(ctx context.Context, id string) error
- func (a *Role) Get(ctx context.Context, id string) (*schema.Role, error)
- func (a *Role) Query(ctx context.Context, params schema.RoleQueryParam) (*schema.RoleQueryResult, error)
- func (a *Role) Update(ctx context.Context, id string, formItem *schema.RoleForm) error
- type User
- func (a *User) Create(ctx context.Context, formItem *schema.UserForm) (*schema.User, error)
- func (a *User) Delete(ctx context.Context, id string) error
- func (a *User) Get(ctx context.Context, id string) (*schema.User, error)
- func (a *User) GetRoleIDs(ctx context.Context, id string) ([]string, error)
- func (a *User) Query(ctx context.Context, params schema.UserQueryParam) (*schema.UserQueryResult, error)
- func (a *User) ResetPassword(ctx context.Context, id string) error
- func (a *User) Update(ctx context.Context, id string, formItem *schema.UserForm) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Login ¶
type Login struct { Cache cachex.Cacher Auth jwtx.Auther UserDAL *dal.User UserRoleDAL *dal.UserRole MenuDAL *dal.Menu UserBIZ *User }
Login management for RBAC
func (*Login) GetCaptcha ¶
This function generates a new captcha ID and returns it as a `schema.Captcha` struct. The length of the captcha is determined by the `config.C.Util.Captcha.Length` configuration value.
func (*Login) GetUserInfo ¶
Get user info
func (*Login) QueryMenus ¶
Query menus based on user permissions
func (*Login) RefreshToken ¶
func (*Login) ResponseCaptcha ¶
func (a *Login) ResponseCaptcha(ctx context.Context, w http.ResponseWriter, id string, reload bool) error
Response captcha image
func (*Login) UpdatePassword ¶
Change login password
func (*Login) UpdateUser ¶
Update current user info
type Menu ¶
type Menu struct { Trans *util.Trans MenuDAL *dal.Menu MenuResourceDAL *dal.MenuResource RoleMenuDAL *dal.RoleMenu }
Menu management for RBAC
func (*Menu) Query ¶
func (a *Menu) Query(ctx context.Context, params schema.MenuQueryParam) (*schema.MenuQueryResult, error)
Query menus from the data access object based on the provided parameters and options.
type Role ¶
type Role struct { Cache cachex.Cacher Trans *util.Trans RoleDAL *dal.Role RoleMenuDAL *dal.RoleMenu UserRoleDAL *dal.UserRole }
Role management for RBAC
func (*Role) Query ¶
func (a *Role) Query(ctx context.Context, params schema.RoleQueryParam) (*schema.RoleQueryResult, error)
Query roles from the data access object based on the provided parameters and options.
type User ¶
type User struct { Cache cachex.Cacher Trans *util.Trans UserDAL *dal.User UserRoleDAL *dal.UserRole }
User management for RBAC
func (*User) GetRoleIDs ¶
func (*User) Query ¶
func (a *User) Query(ctx context.Context, params schema.UserQueryParam) (*schema.UserQueryResult, error)
Query users from the data access object based on the provided parameters and options.