Versions in this module Expand all Collapse all v1 v1.1.0 Dec 5, 2018 Changes in this version type User + func (a *User) QueryUserRoles(ctx context.Context, params schema.UserRoleQueryParam) ([]*schema.UserRole, error) v1.0.0 Nov 30, 2018 Changes in this version + type Common struct + Demo *Demo + Menu *Menu + Role *Role + User *User + func (a *Common) Init(g *inject.Graph, db *mysql.DB) *Common + func (a *Common) TableName(name string) string + func (a *Common) TablePrefix() string + type Demo struct + Common *Common + DB *mysql.DB + 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 struct + Common *Common + DB *mysql.DB + 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 struct + Common *Common + DB *mysql.DB + 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 struct + Common *Common + DB *mysql.DB + 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) 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