Documentation ¶
Index ¶
- Variables
- func LoadCasbinPolicy(ctx context.Context, e *casbin.SyncedEnforcer)
- func ParseOrder(items []*schema.OrderField) []ent.OrderFunc
- type BaseService
- type Demo
- func (a *Demo) Create(ctx context.Context, item schema.Demo) (*schema.Demo, error)
- func (a *Demo) Delete(ctx context.Context, id string) error
- func (a *Demo) Get(ctx context.Context, id string, opts ...schema.DemoQueryOptions) (*schema.Demo, error)
- func (a *Demo) Query(ctx context.Context, params schema.DemoQueryParam, ...) (*schema.DemoQueryResult, error)
- func (a *Demo) Update(ctx context.Context, id string, item schema.Demo) (*schema.Demo, error)
- func (a *Demo) UpdateStatus(ctx context.Context, id string, status int16) error
- type Dict
- func (a *Dict) Create(ctx context.Context, item schema.Dict) (*schema.IDResult, error)
- func (a *Dict) Delete(ctx context.Context, id string) error
- func (a *Dict) DeleteS(ctx context.Context, id string) error
- func (a *Dict) Get(ctx context.Context, id string, opts ...schema.DictQueryOptions) (*schema.Dict, error)
- func (a *Dict) Query(ctx context.Context, params schema.DictQueryParam, ...) (*schema.DictQueryResult, error)
- func (d Dict) QueryItems(ctx context.Context, id string) (schema.DictItems, error)
- func (a *Dict) Update(ctx context.Context, id string, item schema.Dict) error
- func (a *Dict) UpdateStatus(ctx context.Context, id string, status int16) error
- type Menu
- func (a *Menu) Create(ctx context.Context, item schema.Menu) (*schema.IDResult, error)
- func (a *Menu) Delete(ctx context.Context, id string) error
- func (a *Menu) Get(ctx context.Context, id string, opts ...schema.MenuQueryOptions) (*schema.Menu, error)
- func (a *Menu) InitData(ctx context.Context, dataFile string) error
- func (a *Menu) Query(ctx context.Context, params schema.MenuQueryParam, ...) (*schema.MenuQueryResult, error)
- func (a *Menu) QueryActions(ctx context.Context, id string) (schema.MenuActions, error)
- func (a *Menu) Update(ctx context.Context, id string, item schema.Menu) error
- func (a *Menu) UpdateStatus(ctx context.Context, id string, status int16) error
- type Role
- func (a *Role) Create(ctx context.Context, item schema.Role) (*schema.IDResult, error)
- func (a *Role) Delete(ctx context.Context, id string) error
- func (a *Role) Get(ctx context.Context, id string, opts ...schema.RoleQueryOptions) (*schema.Role, error)
- func (a *Role) Query(ctx context.Context, params schema.RoleQueryParam, ...) (*schema.RoleQueryResult, error)
- func (a *Role) QueryRoleMenus(ctx context.Context, roleID string) (schema.RoleMenus, error)
- func (a *Role) Update(ctx context.Context, id string, item schema.Role) error
- func (a *Role) UpdateStatus(ctx context.Context, id string, status int16) error
- type SignIn
- func (a *SignIn) DestroyToken(ctx context.Context, tokenString string) error
- func (a *SignIn) GenerateToken(ctx context.Context, userID string) (*schema.SignInTokenInfo, error)
- func (a *SignIn) GetCaptcha(ctx context.Context, length int) (*schema.SignInCaptcha, error)
- func (a *SignIn) GetSignInInfo(ctx context.Context, userID string) (*schema.UserSignInInfo, error)
- func (a *SignIn) QueryUserMenuTree(ctx context.Context, userID string) (schema.MenuTrees, error)
- func (a *SignIn) ResCaptcha(ctx context.Context, w http.ResponseWriter, captchaID string, ...) error
- func (a *SignIn) UpdatePassword(ctx context.Context, userID string, params schema.UpdatePasswordParam) error
- func (a *SignIn) Verify(ctx context.Context, userName, password string) (*schema.User, error)
- type User
- func (a *User) Create(ctx context.Context, item schema.User) (*schema.IDResult, error)
- func (a *User) Delete(ctx context.Context, id string) error
- func (a *User) Get(ctx context.Context, id string, opts ...schema.UserQueryOptions) (*schema.User, error)
- func (a *User) Query(ctx context.Context, params schema.UserQueryParam, ...) (*schema.UserQueryResult, error)
- func (a *User) QueryShow(ctx context.Context, params schema.UserQueryParam, ...) (*schema.UserShowQueryResult, error)
- func (a *User) Update(ctx context.Context, id string, item schema.User) error
- func (a *User) UpdateStatus(ctx context.Context, id string, status int16) error
Constants ¶
This section is empty.
Variables ¶
DemoSet 注入Demo
MenuSet 注入Menu
RoleSet 注入Role
ServiceSet 注入
SignInSet 注入SignIn
UserSet 注入User
Functions ¶
func LoadCasbinPolicy ¶
LoadCasbinPolicy 异步加载casbin权限策略
func ParseOrder ¶ added in v1.2.0
func ParseOrder(items []*schema.OrderField) []ent.OrderFunc
ParseOrder 解析排序字段
Types ¶
type BaseService ¶ added in v1.2.0
type BaseService struct { }
type Demo ¶
Demo 示例程序
func (*Demo) Get ¶
func (a *Demo) Get(ctx context.Context, id string, opts ...schema.DemoQueryOptions) (*schema.Demo, error)
Get 查询指定数据
func (*Demo) Query ¶
func (a *Demo) Query(ctx context.Context, params schema.DemoQueryParam, opts ...schema.DemoQueryOptions) (*schema.DemoQueryResult, error)
Query 查询数据
type Dict ¶ added in v1.0.5
Demo 示例程序
func (*Dict) Get ¶ added in v1.0.5
func (a *Dict) Get(ctx context.Context, id string, opts ...schema.DictQueryOptions) (*schema.Dict, error)
Get 查询指定数据
func (*Dict) Query ¶ added in v1.0.5
func (a *Dict) Query(ctx context.Context, params schema.DictQueryParam, opts ...schema.DictQueryOptions) (*schema.DictQueryResult, error)
Query 查询数据
func (Dict) QueryItems ¶ added in v1.0.5
type Menu ¶
type Menu struct { MenuModel *repo.Menu MenuActionModel *repo.MenuAction MenuActionResourceModel *repo.MenuActionResource }
Menu 菜单管理
func (*Menu) Get ¶
func (a *Menu) Get(ctx context.Context, id string, opts ...schema.MenuQueryOptions) (*schema.Menu, error)
Get 查询指定数据
func (*Menu) Query ¶
func (a *Menu) Query(ctx context.Context, params schema.MenuQueryParam, opts ...schema.MenuQueryOptions) (*schema.MenuQueryResult, error)
Query 查询数据
func (*Menu) QueryActions ¶
QueryActions 查询动作数据
type Role ¶
type Role struct { Enforcer *casbin.SyncedEnforcer RoleModel *repo.Role RoleMenuModel *repo.RoleMenu UserModel *repo.User }
Role 角色管理
func (*Role) Get ¶
func (a *Role) Get(ctx context.Context, id string, opts ...schema.RoleQueryOptions) (*schema.Role, error)
Get 查询指定数据
func (*Role) Query ¶
func (a *Role) Query(ctx context.Context, params schema.RoleQueryParam, opts ...schema.RoleQueryOptions) (*schema.RoleQueryResult, error)
Query 查询数据
func (*Role) QueryRoleMenus ¶
QueryRoleMenus 查询角色菜单列表
type SignIn ¶
type SignIn struct { Auth auth.Auther UserModel *repo.User UserRoleModel *repo.UserRole RoleModel *repo.Role RoleMenuModel *repo.RoleMenu MenuModel *repo.Menu MenuActionModel *repo.MenuAction Vcode *vcode.Vcode }
SignIn 登录管理
func (*SignIn) DestroyToken ¶
DestroyToken 销毁令牌
func (*SignIn) GenerateToken ¶
GenerateToken 生成令牌
func (*SignIn) GetCaptcha ¶
GetCaptcha 获取图形验证码信息
func (*SignIn) GetSignInInfo ¶
GetSignInInfo 获取当前用户登录信息
func (*SignIn) QueryUserMenuTree ¶
QueryUserMenuTree 查询当前用户的权限菜单树
func (*SignIn) ResCaptcha ¶
func (a *SignIn) ResCaptcha(ctx context.Context, w http.ResponseWriter, captchaID string, width, height int) error
ResCaptcha 生成并响应图形验证码
func (*SignIn) UpdatePassword ¶
func (a *SignIn) UpdatePassword(ctx context.Context, userID string, params schema.UpdatePasswordParam) error
UpdatePassword 更新当前用户登录密码
type User ¶
type User struct { Enforcer *casbin.SyncedEnforcer UserModel *repo.User UserRoleModel *repo.UserRole RoleModel *repo.Role }
User 用户管理
func (*User) Get ¶
func (a *User) Get(ctx context.Context, id string, opts ...schema.UserQueryOptions) (*schema.User, error)
Get 查询指定数据
func (*User) Query ¶
func (a *User) Query(ctx context.Context, params schema.UserQueryParam, opts ...schema.UserQueryOptions) (*schema.UserQueryResult, error)
Query 查询数据
func (*User) QueryShow ¶
func (a *User) QueryShow(ctx context.Context, params schema.UserQueryParam, opts ...schema.UserQueryOptions) (*schema.UserShowQueryResult, error)
QueryShow 查询显示项数据
Click to show internal directories.
Click to hide internal directories.