Documentation ¶
Index ¶
- Variables
- func Check(ctx context.Context, db *gorm.DB) (bool, error)
- func ExecTrans(ctx context.Context, db *gorm.DB, fn TransFunc) error
- func ExecTransWithLock(ctx context.Context, db *gorm.DB, fn TransFunc) error
- func FindOne(ctx context.Context, db *gorm.DB, out interface{}) (bool, error)
- func FindPage(ctx context.Context, db *gorm.DB, pp schema.PaginationParam, out interface{}) (int, error)
- func ParseOrder(items []*schema.OrderField, handle ...OrderFieldFunc) string
- func WrapPageQuery(ctx context.Context, db *gorm.DB, pp schema.PaginationParam, out interface{}) (*schema.PaginationResult, error)
- type Demo
- func (a *Demo) Create(ctx context.Context, item 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) error
- func (a *Demo) UpdateStatus(ctx context.Context, id string, status int) error
- type Menu
- func (a *Menu) Create(ctx context.Context, item schema.Menu) 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) Query(ctx context.Context, params schema.MenuQueryParam, ...) (*schema.MenuQueryResult, error)
- func (a *Menu) Update(ctx context.Context, id string, item schema.Menu) error
- func (a *Menu) UpdateParentPath(ctx context.Context, id, parentPath string) error
- func (a *Menu) UpdateStatus(ctx context.Context, id string, status int) error
- type MenuAction
- func (a *MenuAction) Create(ctx context.Context, item schema.MenuAction) error
- func (a *MenuAction) Delete(ctx context.Context, id string) error
- func (a *MenuAction) DeleteByMenuID(ctx context.Context, menuID string) error
- func (a *MenuAction) Get(ctx context.Context, id string, opts ...schema.MenuActionQueryOptions) (*schema.MenuAction, error)
- func (a *MenuAction) Query(ctx context.Context, params schema.MenuActionQueryParam, ...) (*schema.MenuActionQueryResult, error)
- func (a *MenuAction) Update(ctx context.Context, id string, item schema.MenuAction) error
- type MenuActionResource
- func (a *MenuActionResource) Create(ctx context.Context, item schema.MenuActionResource) error
- func (a *MenuActionResource) Delete(ctx context.Context, id string) error
- func (a *MenuActionResource) DeleteByActionID(ctx context.Context, actionID string) error
- func (a *MenuActionResource) DeleteByMenuID(ctx context.Context, menuID string) error
- func (a *MenuActionResource) Get(ctx context.Context, id string, opts ...schema.MenuActionResourceQueryOptions) (*schema.MenuActionResource, error)
- func (a *MenuActionResource) Query(ctx context.Context, params schema.MenuActionResourceQueryParam, ...) (*schema.MenuActionResourceQueryResult, error)
- func (a *MenuActionResource) Update(ctx context.Context, id string, item schema.MenuActionResource) error
- type OrderFieldFunc
- type Role
- func (a *Role) Create(ctx context.Context, item schema.Role) 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) Update(ctx context.Context, id string, item schema.Role) error
- func (a *Role) UpdateStatus(ctx context.Context, id string, status int) error
- type RoleMenu
- func (a *RoleMenu) Create(ctx context.Context, item schema.RoleMenu) error
- func (a *RoleMenu) Delete(ctx context.Context, id string) error
- func (a *RoleMenu) DeleteByRoleID(ctx context.Context, roleID string) error
- func (a *RoleMenu) Get(ctx context.Context, id string, opts ...schema.RoleMenuQueryOptions) (*schema.RoleMenu, error)
- func (a *RoleMenu) Query(ctx context.Context, params schema.RoleMenuQueryParam, ...) (*schema.RoleMenuQueryResult, error)
- func (a *RoleMenu) Update(ctx context.Context, id string, item schema.RoleMenu) error
- type Trans
- type TransFunc
- type User
- func (a *User) Create(ctx context.Context, item schema.User) 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) Update(ctx context.Context, id string, item schema.User) error
- func (a *User) UpdatePassword(ctx context.Context, id, password string) error
- func (a *User) UpdateStatus(ctx context.Context, id string, status int) error
- type UserRole
- func (a *UserRole) Create(ctx context.Context, item schema.UserRole) error
- func (a *UserRole) Delete(ctx context.Context, id string) error
- func (a *UserRole) DeleteByUserID(ctx context.Context, userID string) error
- func (a *UserRole) Get(ctx context.Context, id string, opts ...schema.UserRoleQueryOptions) (*schema.UserRole, error)
- func (a *UserRole) Query(ctx context.Context, params schema.UserRoleQueryParam, ...) (*schema.UserRoleQueryResult, error)
- func (a *UserRole) Update(ctx context.Context, id string, item schema.UserRole) error
Constants ¶
This section is empty.
Variables ¶
DemoSet 注入Demo
var MenuActionResourceSet = wire.NewSet(wire.Struct(new(MenuActionResource), "*"))
MenuActionResourceSet 注入MenuActionResource
var MenuActionSet = wire.NewSet(wire.Struct(new(MenuAction), "*"))
MenuActionSet 注入MenuAction
MenuSet 注入Menu
var RepoSet = wire.NewSet( DemoSet, MenuActionResourceSet, MenuActionSet, MenuSet, RoleMenuSet, RoleSet, TransSet, UserRoleSet, UserSet, )
RepoSet model注入
RoleMenuSet 注入RoleMenu
RoleSet 注入Role
TransSet 注入Trans
UserRoleSet 注入UserRole
UserSet 注入User
Functions ¶
func ExecTransWithLock ¶
ExecTransWithLock 执行事务(加锁)
func FindPage ¶
func FindPage(ctx context.Context, db *gorm.DB, pp schema.PaginationParam, out interface{}) (int, error)
FindPage 查询分页数据
func ParseOrder ¶
func ParseOrder(items []*schema.OrderField, handle ...OrderFieldFunc) string
ParseOrder 解析排序字段
func WrapPageQuery ¶
func WrapPageQuery(ctx context.Context, db *gorm.DB, pp schema.PaginationParam, out interface{}) (*schema.PaginationResult, error)
WrapPageQuery 包装带有分页的查询
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 Menu ¶
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) UpdateParentPath ¶
UpdateParentPath 更新父级路径
type MenuAction ¶
MenuAction 菜单动作存储
func (*MenuAction) Create ¶
func (a *MenuAction) Create(ctx context.Context, item schema.MenuAction) error
Create 创建数据
func (*MenuAction) Delete ¶
func (a *MenuAction) Delete(ctx context.Context, id string) error
Delete 删除数据
func (*MenuAction) DeleteByMenuID ¶
func (a *MenuAction) DeleteByMenuID(ctx context.Context, menuID string) error
DeleteByMenuID 根据菜单ID删除数据
func (*MenuAction) Get ¶
func (a *MenuAction) Get(ctx context.Context, id string, opts ...schema.MenuActionQueryOptions) (*schema.MenuAction, error)
Get 查询指定数据
func (*MenuAction) Query ¶
func (a *MenuAction) Query(ctx context.Context, params schema.MenuActionQueryParam, opts ...schema.MenuActionQueryOptions) (*schema.MenuActionQueryResult, error)
Query 查询数据
func (*MenuAction) Update ¶
func (a *MenuAction) Update(ctx context.Context, id string, item schema.MenuAction) error
Update 更新数据
type MenuActionResource ¶
MenuActionResource 菜单动作关联资源存储
func (*MenuActionResource) Create ¶
func (a *MenuActionResource) Create(ctx context.Context, item schema.MenuActionResource) error
Create 创建数据
func (*MenuActionResource) Delete ¶
func (a *MenuActionResource) Delete(ctx context.Context, id string) error
Delete 删除数据
func (*MenuActionResource) DeleteByActionID ¶
func (a *MenuActionResource) DeleteByActionID(ctx context.Context, actionID string) error
DeleteByActionID 根据动作ID删除数据
func (*MenuActionResource) DeleteByMenuID ¶
func (a *MenuActionResource) DeleteByMenuID(ctx context.Context, menuID string) error
DeleteByMenuID 根据菜单ID删除数据
func (*MenuActionResource) Get ¶
func (a *MenuActionResource) Get(ctx context.Context, id string, opts ...schema.MenuActionResourceQueryOptions) (*schema.MenuActionResource, error)
Get 查询指定数据
func (*MenuActionResource) Query ¶
func (a *MenuActionResource) Query(ctx context.Context, params schema.MenuActionResourceQueryParam, opts ...schema.MenuActionResourceQueryOptions) (*schema.MenuActionResourceQueryResult, error)
Query 查询数据
func (*MenuActionResource) Update ¶
func (a *MenuActionResource) Update(ctx context.Context, id string, item schema.MenuActionResource) error
Update 更新数据
type Role ¶
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 查询数据
type RoleMenu ¶
RoleMenu 角色菜单存储
func (*RoleMenu) DeleteByRoleID ¶
DeleteByRoleID 根据角色ID删除数据
func (*RoleMenu) Get ¶
func (a *RoleMenu) Get(ctx context.Context, id string, opts ...schema.RoleMenuQueryOptions) (*schema.RoleMenu, error)
Get 查询指定数据
func (*RoleMenu) Query ¶
func (a *RoleMenu) Query(ctx context.Context, params schema.RoleMenuQueryParam, opts ...schema.RoleMenuQueryOptions) (*schema.RoleMenuQueryResult, error)
Query 查询数据
type User ¶
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) UpdatePassword ¶
UpdatePassword 更新密码
type UserRole ¶
UserRole 用户角色存储
func (*UserRole) DeleteByUserID ¶
DeleteByUserID 根据用户ID删除数据
func (*UserRole) Get ¶
func (a *UserRole) Get(ctx context.Context, id string, opts ...schema.UserRoleQueryOptions) (*schema.UserRole, error)
Get 查询指定数据
func (*UserRole) Query ¶
func (a *UserRole) Query(ctx context.Context, params schema.UserRoleQueryParam, opts ...schema.UserRoleQueryOptions) (*schema.UserRoleQueryResult, error)
Query 查询数据