Documentation ¶
Index ¶
- type Common
- type Demo
- func (a *Demo) Check(ctx context.Context, recordID string) (bool, error)
- 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) Init(g *inject.Graph, db *mysql.DB, c *Common) *Demo
- func (a *Demo) QueryPage(ctx context.Context, params schema.DemoQueryParam, pageIndex, pageSize uint) (int64, []*schema.DemoQueryResult, error)
- func (a *Demo) TableName() string
- func (a *Demo) Update(ctx context.Context, recordID string, info map[string]interface{}) error
- type Menu
- func (a *Menu) Check(ctx context.Context, recordID string) (bool, error)
- func (a *Menu) CheckChild(ctx context.Context, parentID string) (bool, error)
- func (a *Menu) CheckCode(ctx context.Context, code string, parentID string) (bool, error)
- 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) GetByCodeAndType(ctx context.Context, code string, typ int) (*schema.Menu, error)
- func (a *Menu) Init(g *inject.Graph, db *mysql.DB, c *Common) *Menu
- func (a *Menu) QueryLevelCodesByParentID(parentID string) ([]string, error)
- func (a *Menu) QueryLevelCodesByUserID(userID string) ([]string, error)
- func (a *Menu) QueryPage(ctx context.Context, params schema.MenuQueryParam, pageIndex, pageSize uint) (int64, []*schema.MenuQueryResult, error)
- func (a *Menu) QuerySelect(ctx context.Context, params schema.MenuSelectQueryParam) ([]*schema.MenuSelectQueryResult, error)
- func (a *Menu) TableName() string
- func (a *Menu) Update(ctx context.Context, recordID string, info map[string]interface{}) error
- func (a *Menu) UpdateWithLevelCode(ctx context.Context, recordID string, info map[string]interface{}, ...) error
- type Role
- func (a *Role) Check(ctx context.Context, recordID string) (bool, error)
- func (a *Role) CheckName(ctx context.Context, name string) (bool, error)
- 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, includeMenuIDs bool) (*schema.Role, error)
- func (a *Role) Init(g *inject.Graph, db *mysql.DB, c *Common) *Role
- func (a *Role) QueryMenuIDs(ctx context.Context, roleID string) ([]string, 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) RoleMenuTableName() string
- func (a *Role) TableName() string
- func (a *Role) Update(ctx context.Context, recordID string, info map[string]interface{}) error
- func (a *Role) UpdateWithMenuIDs(ctx context.Context, recordID string, info map[string]interface{}, ...) error
- type User
- func (a *User) Check(ctx context.Context, recordID string) (bool, error)
- func (a *User) CheckByRoleID(ctx context.Context, roleID string) (bool, error)
- func (a *User) CheckUserName(ctx context.Context, userName 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, includeRoleIDs bool) (*schema.User, error)
- func (a *User) GetByUserName(ctx context.Context, userName string, includeRoleIDs bool) (*schema.User, error)
- func (a *User) Init(g *inject.Graph, db *mysql.DB, c *Common) *User
- func (a *User) QueryPage(ctx context.Context, params schema.UserQueryParam, pageIndex, pageSize uint) (int64, []*schema.UserQueryResult, error)
- func (a *User) QueryRoleIDs(ctx context.Context, userID string) ([]string, error)
- func (a *User) QueryUserRoles(ctx context.Context, params schema.UserRoleQueryParam) ([]*schema.UserRole, error)
- func (a *User) TableName() string
- func (a *User) Update(ctx context.Context, recordID string, info map[string]interface{}) error
- func (a *User) UpdateWithRoleIDs(ctx context.Context, recordID string, info map[string]interface{}, ...) error
- func (a *User) UserRoleTableName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Demo ¶
Demo 示例程序
type Menu ¶
Menu 菜单管理
func (*Menu) CheckChild ¶
CheckChild 检查子级是否存在
func (*Menu) GetByCodeAndType ¶
GetByCodeAndType 根据编号和类型查询指定数据
func (*Menu) QueryLevelCodesByParentID ¶
QueryLevelCodesByParentID 根据父级查询分级码
func (*Menu) QueryLevelCodesByUserID ¶
QueryLevelCodesByUserID 查询用户所拥有的菜单权限
func (*Menu) QueryPage ¶
func (a *Menu) QueryPage(ctx context.Context, params schema.MenuQueryParam, pageIndex, pageSize uint) (int64, []*schema.MenuQueryResult, error)
QueryPage 查询分页数据
func (*Menu) QuerySelect ¶
func (a *Menu) QuerySelect(ctx context.Context, params schema.MenuSelectQueryParam) ([]*schema.MenuSelectQueryResult, error)
QuerySelect 查询选择数据
type Role ¶
Role 角色管理
func (*Role) QueryMenuIDs ¶
QueryMenuIDs 查询角色菜单
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) CheckByRoleID ¶
CheckByRoleID 检查角色下是否存在用户
func (*User) CheckUserName ¶
CheckUserName 检查用户名
func (*User) GetByUserName ¶
func (a *User) GetByUserName(ctx context.Context, userName string, includeRoleIDs bool) (*schema.User, error)
GetByUserName 根据用户名查询指定数据
func (*User) QueryPage ¶
func (a *User) QueryPage(ctx context.Context, params schema.UserQueryParam, pageIndex, pageSize uint) (int64, []*schema.UserQueryResult, error)
QueryPage 查询分页数据
func (*User) QueryRoleIDs ¶
QueryRoleIDs 查询用户角色
func (*User) QueryUserRoles ¶ added in v1.1.0
func (a *User) QueryUserRoles(ctx context.Context, params schema.UserRoleQueryParam) ([]*schema.UserRole, error)
QueryUserRoles 查询用户角色
Click to show internal directories.
Click to hide internal directories.