Documentation ¶
Index ¶
- Variables
- type Demo
- func (a *Demo) Create(ctx context.Context, item *schema.Demo) error
- func (a *Demo) Delete(ctx context.Context, recordID string) error
- func (a *Demo) Get(ctx context.Context, recordID string) (*schema.Demo, error)
- func (a *Demo) QueryPage(ctx context.Context, params schema.DemoQueryParam, pageIndex, pageSize uint) (int64, []*schema.DemoQueryResult, error)
- func (a *Demo) Update(ctx context.Context, recordID string, item *schema.Demo) error
- type Login
- type Menu
- func (a *Menu) Create(ctx context.Context, item *schema.Menu) error
- func (a *Menu) Delete(ctx context.Context, recordID string) error
- func (a *Menu) Get(ctx context.Context, recordID string) (*schema.Menu, error)
- func (a *Menu) QueryPage(ctx context.Context, params schema.MenuQueryParam, pageIndex, pageSize uint) (int64, []*schema.MenuQueryResult, error)
- func (a *Menu) QueryTree(ctx context.Context, params schema.MenuSelectQueryParam) ([]map[string]interface{}, error)
- func (a *Menu) Update(ctx context.Context, recordID string, item *schema.Menu) error
- func (a *Menu) UpdateStatus(ctx context.Context, recordID string, status int) error
- type Role
- func (a *Role) Create(ctx context.Context, item *schema.Role) error
- func (a *Role) Delete(ctx context.Context, recordID string) error
- func (a *Role) Get(ctx context.Context, recordID string) (*schema.Role, error)
- func (a *Role) QueryPage(ctx context.Context, params schema.RoleQueryParam, pageIndex, pageSize uint) (int64, []*schema.RoleQueryResult, error)
- func (a *Role) QuerySelect(ctx context.Context, params schema.RoleSelectQueryParam) ([]*schema.RoleSelectQueryResult, error)
- func (a *Role) Update(ctx context.Context, recordID string, item *schema.Role) error
- func (a *Role) UpdateStatus(ctx context.Context, recordID string, status int) error
- type User
- func (a *User) CheckIsAdmin(ctx context.Context, recordID string) (bool, error)
- func (a *User) Create(ctx context.Context, item *schema.User) error
- func (a *User) Delete(ctx context.Context, recordID string) error
- func (a *User) Get(ctx context.Context, recordID string) (*schema.User, error)
- func (a *User) QueryPage(ctx context.Context, params schema.UserQueryParam, pageIndex, pageSize uint) (int64, []*schema.UserQueryResult, error)
- func (a *User) Update(ctx context.Context, recordID string, item *schema.User) error
- func (a *User) UpdateStatus(ctx context.Context, recordID string, status int) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidUser = errors.New("无效的用户") ErrInvalidUserName = errors.New("无效的用户名") ErrInvalidPassword = errors.New("无效的密码") ErrUserDisable = errors.New("用户被禁用") )
定义错误
Functions ¶
This section is empty.
Types ¶
type Demo ¶
Demo 示例程序
type Login ¶
type Login struct { UserModel model.IUser `inject:"IUser"` RoleModel model.IRole `inject:"IRole"` MenuModel model.IMenu `inject:"IMenu"` UserBll *User `inject:""` }
Login 登录管理
func (*Login) GetCurrentUserInfo ¶
GetCurrentUserInfo 获取当前用户信息
type Menu ¶
type Menu struct { MenuModel model.IMenu `inject:"IMenu"` // contains filtered or unexported fields }
Menu 菜单管理
func (*Menu) QueryPage ¶
func (a *Menu) QueryPage(ctx context.Context, params schema.MenuQueryParam, pageIndex, pageSize uint) (int64, []*schema.MenuQueryResult, error)
QueryPage 查询分页数据
func (*Menu) QueryTree ¶
func (a *Menu) QueryTree(ctx context.Context, params schema.MenuSelectQueryParam) ([]map[string]interface{}, error)
QueryTree 查询菜单树
type Role ¶
type Role struct { RoleModel model.IRole `inject:"IRole"` MenuModel model.IMenu `inject:"IMenu"` UserModel model.IUser `inject:"IUser"` }
Role 角色管理
func (*Role) QueryPage ¶
func (a *Role) QueryPage(ctx context.Context, params schema.RoleQueryParam, pageIndex, pageSize uint) (int64, []*schema.RoleQueryResult, error)
QueryPage 查询分页数据
func (*Role) QuerySelect ¶
func (a *Role) QuerySelect(ctx context.Context, params schema.RoleSelectQueryParam) ([]*schema.RoleSelectQueryResult, error)
QuerySelect 查询选择数据
type User ¶
User 用户管理
func (*User) CheckIsAdmin ¶
CheckIsAdmin 检查是否是管理员
func (*User) QueryPage ¶
func (a *User) QueryPage(ctx context.Context, params schema.UserQueryParam, pageIndex, pageSize uint) (int64, []*schema.UserQueryResult, error)
QueryPage 查询分页数据
Click to show internal directories.
Click to hide internal directories.