Documentation ¶
Index ¶
- Variables
- func ExecTrans(ctx context.Context, transModel model.ITrans, fn TransFunc) error
- func ExecTransWithLock(ctx context.Context, transModel model.ITrans, fn TransFunc) error
- func LoadCasbinPolicy(ctx context.Context, e *casbin.SyncedEnforcer)
- func NewNoTrans(ctx context.Context) context.Context
- type App
- type Demo
- func (a *Demo) Create(ctx context.Context, item schema.Demo) (*schema.IDResult, 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) error
- func (a *Demo) UpdateStatus(ctx context.Context, id string, status int) error
- type GPlatform
- func (a *GPlatform) Check(ctx context.Context, appId string) error
- func (a *GPlatform) Create(ctx context.Context, item schema.GPlatform) error
- func (a *GPlatform) Delete(ctx context.Context, id string) error
- func (a *GPlatform) Get(ctx context.Context, id string, opts ...schema.GPlatformQueryOptions) (*schema.GPlatform, error)
- func (a *GPlatform) GetByAppId(ctx context.Context, appId string) (*schema.GPlatform, error)
- func (a *GPlatform) GetOptions(ctx context.Context) (*schema.GPlatformSelectOptions, error)
- func (a *GPlatform) Query(ctx context.Context, params schema.GPlatformQueryParam, ...) (*schema.GPlatformQueryResult, error)
- func (a *GPlatform) Update(ctx context.Context, id string, item schema.GPlatform) error
- func (a *GPlatform) UpdateStatus(ctx context.Context, id string, status int) error
- type GTplMall
- func (a *GTplMall) Check(ctx context.Context, appId string) error
- func (a *GTplMall) Create(ctx context.Context, item schema.GTplMall) error
- func (a *GTplMall) Delete(ctx context.Context, id string) error
- func (a *GTplMall) Get(ctx context.Context, id string, opts ...schema.GTplMallQueryOptions) (*schema.GTplMall, error)
- func (a *GTplMall) GetByIdentify(ctx context.Context, identify string) (*schema.GTplMall, error)
- func (a *GTplMall) InitData(ctx context.Context, dataFile string) error
- func (a *GTplMall) Query(ctx context.Context, params schema.GTplMallQueryParam, ...) (*schema.GTplMallQueryResult, error)
- func (a *GTplMall) Update(ctx context.Context, id string, item schema.GTplMall) error
- func (a *GTplMall) UpdateStatus(ctx context.Context, id string, status int) error
- type Login
- func (a *Login) DestroyToken(ctx context.Context, tokenString string) error
- func (a *Login) GenerateToken(ctx context.Context, userID string) (*schema.LoginTokenInfo, error)
- func (a *Login) GetCaptcha(ctx context.Context, length int) (*schema.LoginCaptcha, error)
- func (a *Login) GetLoginInfo(ctx context.Context, userID string) (*schema.UserLoginInfo, error)
- func (a *Login) Permissions(ctx context.Context, userID string) (schema.Permissions, error)
- func (a *Login) QueryUserMenuTree(ctx context.Context, userID string) (schema.MenuTrees, error)
- func (a *Login) ResCaptcha(ctx context.Context, w http.ResponseWriter, captchaID string, ...) error
- func (a *Login) UpdatePassword(ctx context.Context, userID string, params schema.UpdatePasswordParam) error
- func (a *Login) Verify(ctx context.Context, userName, password string) (*schema.User, 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) GetByRouter(ctx context.Context, router string) (*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 int) error
- type PageManager
- func (a *PageManager) Create(ctx context.Context, item schema.PageManager) error
- func (a *PageManager) Delete(ctx context.Context, id string) error
- func (a *PageManager) Get(ctx context.Context, id string, opts ...schema.PageManagerQueryOptions) (*schema.PageManager, error)
- func (a *PageManager) GetByRoute(ctx context.Context, route string, opts ...schema.PageManagerQueryOptions) (*schema.PageManager, error)
- func (a *PageManager) GetLastId(ctx context.Context) (int, error)
- func (a *PageManager) History(ctx context.Context, params schema.PageVersionHistoryQueryParam, ...) (*schema.PageVersionHistoryQueryResult, error)
- func (a *PageManager) InitData(ctx context.Context, dataFile string) error
- func (a *PageManager) Query(ctx context.Context, params schema.PageManagerQueryParam, ...) (*schema.PageManagerQueryResult, error)
- func (a *PageManager) Revert(ctx context.Context, pageVersionHistoryId string) error
- func (a *PageManager) Update(ctx context.Context, id string, item schema.PageManager) error
- func (a *PageManager) UpdateStatus(ctx context.Context, id string, status int) error
- type PageVersionHistory
- 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 int) error
- type Setting
- func (a *Setting) Create(ctx context.Context, item schema.Setting) error
- func (a *Setting) Delete(ctx context.Context, id string) error
- func (a *Setting) Get(ctx context.Context, id string) (*schema.Setting, error)
- func (a *Setting) Query(ctx context.Context) (*schema.SettingQueryResult, error)
- func (a *Setting) Truncate(ctx context.Context) error
- func (a *Setting) Update(ctx context.Context, id string, item schema.Setting) error
- type TransFunc
- 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 int) error
Constants ¶
This section is empty.
Variables ¶
var AppSet = wire.NewSet(wire.Struct(new(App), "*"), wire.Bind(new(bll.IApp), new(*App)))
var BllSet = wire.NewSet( DemoSet, LoginSet, MenuSet, RoleSet, UserSet, PageManagerSet, SettingSet, AppSet, )
BllSet bll注入
var DemoSet = wire.NewSet(wire.Struct(new(Demo), "*"), wire.Bind(new(bll.IDemo), new(*Demo)))
DemoSet 注入Demo
var GPlatformSet = wire.NewSet(wire.Struct(new(GPlatform), "*"), wire.Bind(new(bll.IGPlatform), new(*GPlatform)))
GPlatformSet 注入GPlatform
var GTplMallSet = wire.NewSet(wire.Struct(new(GTplMall), "*"), wire.Bind(new(bll.IGTplMall), new(*GTplMall)))
GTplMallSet 注入GTplMall
var LoginSet = wire.NewSet(wire.Struct(new(Login), "*"), wire.Bind(new(bll.ILogin), new(*Login)))
LoginSet 注入Login
var MenuSet = wire.NewSet(wire.Struct(new(Menu), "*"), wire.Bind(new(bll.IMenu), new(*Menu)))
MenuSet 注入Menu
var PageManagerSet = wire.NewSet(wire.Struct(new(PageManager), "*"), wire.Bind(new(bll.IPageManager), new(*PageManager)))
PageManagerSet 注入PageManager
var PageVersionHistorySet = wire.NewSet(wire.Struct(new(PageVersionHistory), "*"), wire.Bind(new(bll.IPageVersionHistory), new(*PageVersionHistory)))
PageVersionHistorySet 注入PageVersionHistory
var RoleSet = wire.NewSet(wire.Struct(new(Role), "*"), wire.Bind(new(bll.IRole), new(*Role)))
RoleSet 注入Role
var SettingSet = wire.NewSet(wire.Struct(new(Setting), "*"), wire.Bind(new(bll.ISetting), new(*Setting)))
SettingSet 注入Setting
var UserSet = wire.NewSet(wire.Struct(new(User), "*"), wire.Bind(new(bll.IUser), new(*User)))
UserSet 注入User
Functions ¶
func ExecTransWithLock ¶
ExecTransWithLock 执行事务(加锁)
func LoadCasbinPolicy ¶
LoadCasbinPolicy 异步加载casbin权限策略
Types ¶
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 GPlatform ¶ added in v1.0.1
type GPlatform struct {
GPlatformModel model.IGPlatform
}
GPlatform 示例程序
func (*GPlatform) Get ¶ added in v1.0.1
func (a *GPlatform) Get(ctx context.Context, id string, opts ...schema.GPlatformQueryOptions) (*schema.GPlatform, error)
Get 查询指定数据
func (*GPlatform) GetByAppId ¶ added in v1.0.1
func (*GPlatform) GetOptions ¶ added in v1.0.1
func (*GPlatform) Query ¶ added in v1.0.1
func (a *GPlatform) Query(ctx context.Context, params schema.GPlatformQueryParam, opts ...schema.GPlatformQueryOptions) (*schema.GPlatformQueryResult, error)
Query 查询数据
type GTplMall ¶ added in v1.0.1
GTplMall 示例程序
func (*GTplMall) Get ¶ added in v1.0.1
func (a *GTplMall) Get(ctx context.Context, id string, opts ...schema.GTplMallQueryOptions) (*schema.GTplMall, error)
Get 查询指定数据
func (*GTplMall) GetByIdentify ¶ added in v1.0.1
func (*GTplMall) Query ¶ added in v1.0.1
func (a *GTplMall) Query(ctx context.Context, params schema.GTplMallQueryParam, opts ...schema.GTplMallQueryOptions) (*schema.GTplMallQueryResult, error)
Query 查询数据
type Login ¶
type Login struct { Enforcer *casbin.SyncedEnforcer Auth auth.Auther UserModel model.IUser UserRoleModel model.IUserRole RoleModel model.IRole RoleMenuModel model.IRoleMenu MenuModel model.IMenu MenuActionModel model.IMenuAction }
Login 登录管理
func (*Login) DestroyToken ¶
DestroyToken 销毁令牌
func (*Login) GenerateToken ¶
GenerateToken 生成令牌
func (*Login) GetCaptcha ¶
GetCaptcha 获取图形验证码信息
func (*Login) GetLoginInfo ¶
GetLoginInfo 获取当前用户登录信息
func (*Login) Permissions ¶ added in v1.0.2
func (*Login) QueryUserMenuTree ¶
QueryUserMenuTree 查询当前用户的权限菜单树
func (*Login) ResCaptcha ¶
func (a *Login) ResCaptcha(ctx context.Context, w http.ResponseWriter, captchaID string, width, height int) error
ResCaptcha 生成并响应图形验证码
func (*Login) UpdatePassword ¶
func (a *Login) UpdatePassword(ctx context.Context, userID string, params schema.UpdatePasswordParam) error
UpdatePassword 更新当前用户登录密码
type Menu ¶
type Menu struct { TransModel model.ITrans MenuModel model.IMenu MenuActionModel model.IMenuAction MenuActionResourceModel model.IMenuActionResource }
Menu 菜单管理
func (*Menu) Get ¶
func (a *Menu) Get(ctx context.Context, id string, opts ...schema.MenuQueryOptions) (*schema.Menu, error)
Get 查询指定数据
func (*Menu) GetByRouter ¶
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 PageManager ¶
type PageManager struct { TransModel model.ITrans PageManagerModel model.IPageManager PageVersionHistoryModel model.IPageVersionHistory }
页面管理
func (*PageManager) Create ¶
func (a *PageManager) Create(ctx context.Context, item schema.PageManager) error
创建数据
func (*PageManager) Delete ¶
func (a *PageManager) Delete(ctx context.Context, id string) error
删除数据
func (*PageManager) Get ¶
func (a *PageManager) Get(ctx context.Context, id string, opts ...schema.PageManagerQueryOptions) (*schema.PageManager, error)
查询指定数据
func (*PageManager) GetByRoute ¶
func (a *PageManager) GetByRoute(ctx context.Context, route string, opts ...schema.PageManagerQueryOptions) (*schema.PageManager, error)
查询指定数据
func (*PageManager) GetLastId ¶
func (a *PageManager) GetLastId(ctx context.Context) (int, error)
更新状态
func (*PageManager) History ¶
func (a *PageManager) History(ctx context.Context, params schema.PageVersionHistoryQueryParam, opts ...schema.PageVersionHistoryQueryOptions) (*schema.PageVersionHistoryQueryResult, error)
func (*PageManager) InitData ¶
func (a *PageManager) InitData(ctx context.Context, dataFile string) error
InitData 初始化页面管理数据
func (*PageManager) Query ¶
func (a *PageManager) Query(ctx context.Context, params schema.PageManagerQueryParam, opts ...schema.PageManagerQueryOptions) (*schema.PageManagerQueryResult, error)
查询数据
func (*PageManager) Revert ¶
func (a *PageManager) Revert(ctx context.Context, pageVersionHistoryId string) error
更新数据
func (*PageManager) Update ¶
func (a *PageManager) Update(ctx context.Context, id string, item schema.PageManager) error
更新数据
func (*PageManager) UpdateStatus ¶
更新状态
type PageVersionHistory ¶
type PageVersionHistory struct { TransModel model.ITrans PageVersionHistoryModel model.IPageVersionHistory }
页面管理
func (*PageVersionHistory) Get ¶
func (a *PageVersionHistory) Get(ctx context.Context, id string, opts ...schema.PageVersionHistoryQueryOptions) (*schema.PageVersionHistory, error)
查询指定数据
func (*PageVersionHistory) Query ¶
func (a *PageVersionHistory) Query(ctx context.Context, params schema.PageVersionHistoryQueryParam, opts ...schema.PageVersionHistoryQueryOptions) (*schema.PageVersionHistoryQueryResult, error)
查询数据
type Role ¶
type Role struct { Enforcer *casbin.SyncedEnforcer TransModel model.ITrans RoleModel model.IRole RoleMenuModel model.IRoleMenu UserModel model.IUser }
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 Setting ¶
Setting 示例程序
type User ¶
type User struct { Enforcer *casbin.SyncedEnforcer TransModel model.ITrans UserModel model.IUser UserRoleModel model.IUserRole RoleModel model.IRole }
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 查询显示项数据