Documentation ¶
Index ¶
- Variables
- func GetMenuActionDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- func GetMenuActionResourceDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- func GetMenuDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- type Menu
- type MenuAction
- type MenuActionRepo
- func (a *MenuActionRepo) Create(ctx context.Context, item schema.MenuAction) error
- func (a *MenuActionRepo) Delete(ctx context.Context, id uint64) error
- func (a *MenuActionRepo) DeleteByMenuID(ctx context.Context, menuID uint64) error
- func (a *MenuActionRepo) Get(ctx context.Context, id uint64, opts ...schema.MenuActionQueryOptions) (*schema.MenuAction, error)
- func (a *MenuActionRepo) Query(ctx context.Context, params schema.MenuActionQueryParam, ...) (*schema.MenuActionQueryResult, error)
- func (a *MenuActionRepo) Update(ctx context.Context, id uint64, item schema.MenuAction) error
- type MenuActionResource
- type MenuActionResourceRepo
- func (a *MenuActionResourceRepo) Create(ctx context.Context, item schema.MenuActionResource) error
- func (a *MenuActionResourceRepo) Delete(ctx context.Context, id uint64) error
- func (a *MenuActionResourceRepo) DeleteByActionID(ctx context.Context, actionID uint64) error
- func (a *MenuActionResourceRepo) DeleteByMenuID(ctx context.Context, menuID uint64) error
- func (a *MenuActionResourceRepo) Get(ctx context.Context, id uint64, opts ...schema.MenuActionResourceQueryOptions) (*schema.MenuActionResource, error)
- func (a *MenuActionResourceRepo) Query(ctx context.Context, params schema.MenuActionResourceQueryParam, ...) (*schema.MenuActionResourceQueryResult, error)
- func (a *MenuActionResourceRepo) Update(ctx context.Context, id uint64, item schema.MenuActionResource) error
- type MenuActionResources
- type MenuActions
- type MenuRepo
- func (a *MenuRepo) Create(ctx context.Context, item schema.Menu) error
- func (a *MenuRepo) Delete(ctx context.Context, id uint64) error
- func (a *MenuRepo) Get(ctx context.Context, id uint64, opts ...schema.MenuQueryOptions) (*schema.Menu, error)
- func (a *MenuRepo) Query(ctx context.Context, params schema.MenuQueryParam, ...) (*schema.MenuQueryResult, error)
- func (a *MenuRepo) Update(ctx context.Context, id uint64, item schema.Menu) error
- func (a *MenuRepo) UpdateParentPath(ctx context.Context, id uint64, parentPath string) error
- func (a *MenuRepo) UpdateStatus(ctx context.Context, id uint64, status int) error
- type Menus
- type SchemaMenu
- type SchemaMenuAction
- type SchemaMenuActionResource
Constants ¶
This section is empty.
Variables ¶
var MenuActionResourceSet = wire.NewSet(wire.Struct(new(MenuActionResourceRepo), "*"))
MenuActionResourceSet 注入MenuActionResource
var MenuActionSet = wire.NewSet(wire.Struct(new(MenuActionRepo), "*"))
MenuActionSet 注入MenuAction
MenuSet 注入Menu
Functions ¶
func GetMenuActionDB ¶
GetMenuActionDB 菜单动作
func GetMenuActionResourceDB ¶
GetMenuActionResourceDB 菜单动作关联资源
Types ¶
type Menu ¶
type Menu struct { util.Model Name string `gorm:"size:50;index;default:'';not null;"` // 菜单名称 Icon *string `gorm:"size:255;"` // 菜单图标 Router *string `gorm:"size:255;"` // 访问路由 ParentID *uint64 `gorm:"index;default:0;"` // 父级内码 ParentPath *string `gorm:"size:512;index;default:'';"` // 父级路径 IsShow int `gorm:"index;default:0;"` // 是否显示(1:显示 2:隐藏) Status int `gorm:"index;default:0;"` // 状态(1:启用 2:禁用) Sequence int `gorm:"index;default:0;"` // 排序值 Memo *string `gorm:"size:1024;"` // 备注 Creator uint64 `gorm:""` // 创建人 }
Menu 菜单实体
type MenuAction ¶
type MenuAction struct { util.Model MenuID uint64 `gorm:"index;not null;"` // 菜单ID Code string `gorm:"size:100;"` // 动作编号 Name string `gorm:"size:100;"` // 动作名称 }
MenuAction 菜单动作实体
func (MenuAction) ToSchemaMenuAction ¶
func (a MenuAction) ToSchemaMenuAction() *schema.MenuAction
ToSchemaMenuAction 转换为菜单动作对象
type MenuActionRepo ¶
MenuActionRepo 菜单动作存储
func (*MenuActionRepo) Create ¶
func (a *MenuActionRepo) Create(ctx context.Context, item schema.MenuAction) error
Create 创建数据
func (*MenuActionRepo) Delete ¶
func (a *MenuActionRepo) Delete(ctx context.Context, id uint64) error
Delete 删除数据
func (*MenuActionRepo) DeleteByMenuID ¶
func (a *MenuActionRepo) DeleteByMenuID(ctx context.Context, menuID uint64) error
DeleteByMenuID 根据菜单ID删除数据
func (*MenuActionRepo) Get ¶
func (a *MenuActionRepo) Get(ctx context.Context, id uint64, opts ...schema.MenuActionQueryOptions) (*schema.MenuAction, error)
Get 查询指定数据
func (*MenuActionRepo) Query ¶
func (a *MenuActionRepo) Query(ctx context.Context, params schema.MenuActionQueryParam, opts ...schema.MenuActionQueryOptions) (*schema.MenuActionQueryResult, error)
Query 查询数据
func (*MenuActionRepo) Update ¶
func (a *MenuActionRepo) Update(ctx context.Context, id uint64, item schema.MenuAction) error
Update 更新数据
type MenuActionResource ¶
type MenuActionResource struct { util.Model ActionID uint64 `gorm:"index;not null;"` // 菜单动作ID Method string `gorm:"size:50;"` // 资源请求方式(支持正则) Path string `gorm:"size:255;"` // 资源请求路径(支持/:id匹配) }
MenuActionResource 菜单动作关联资源实体
func (MenuActionResource) ToSchemaMenuActionResource ¶
func (a MenuActionResource) ToSchemaMenuActionResource() *schema.MenuActionResource
ToSchemaMenuActionResource 转换为菜单动作关联资源对象
type MenuActionResourceRepo ¶
MenuActionResourceRepo 菜单动作关联资源存储
func (*MenuActionResourceRepo) Create ¶
func (a *MenuActionResourceRepo) Create(ctx context.Context, item schema.MenuActionResource) error
Create 创建数据
func (*MenuActionResourceRepo) Delete ¶
func (a *MenuActionResourceRepo) Delete(ctx context.Context, id uint64) error
Delete 删除数据
func (*MenuActionResourceRepo) DeleteByActionID ¶
func (a *MenuActionResourceRepo) DeleteByActionID(ctx context.Context, actionID uint64) error
DeleteByActionID 根据动作ID删除数据
func (*MenuActionResourceRepo) DeleteByMenuID ¶
func (a *MenuActionResourceRepo) DeleteByMenuID(ctx context.Context, menuID uint64) error
DeleteByMenuID 根据菜单ID删除数据
func (*MenuActionResourceRepo) Get ¶
func (a *MenuActionResourceRepo) Get(ctx context.Context, id uint64, opts ...schema.MenuActionResourceQueryOptions) (*schema.MenuActionResource, error)
Get 查询指定数据
func (*MenuActionResourceRepo) Query ¶
func (a *MenuActionResourceRepo) Query(ctx context.Context, params schema.MenuActionResourceQueryParam, opts ...schema.MenuActionResourceQueryOptions) (*schema.MenuActionResourceQueryResult, error)
Query 查询数据
func (*MenuActionResourceRepo) Update ¶
func (a *MenuActionResourceRepo) Update(ctx context.Context, id uint64, item schema.MenuActionResource) error
Update 更新数据
type MenuActionResources ¶
type MenuActionResources []*MenuActionResource
MenuActionResources 菜单动作关联资源列表
func (MenuActionResources) ToSchemaMenuActionResources ¶
func (a MenuActionResources) ToSchemaMenuActionResources() []*schema.MenuActionResource
ToSchemaMenuActionResources 转换为菜单动作关联资源对象列表
type MenuActions ¶
type MenuActions []*MenuAction
MenuActions 菜单动作列表
func (MenuActions) ToSchemaMenuActions ¶
func (a MenuActions) ToSchemaMenuActions() []*schema.MenuAction
ToSchemaMenuActions 转换为菜单动作对象列表
type MenuRepo ¶
MenuRepo 菜单存储
func (*MenuRepo) Get ¶
func (a *MenuRepo) Get(ctx context.Context, id uint64, opts ...schema.MenuQueryOptions) (*schema.Menu, error)
Get 查询指定数据
func (*MenuRepo) Query ¶
func (a *MenuRepo) Query(ctx context.Context, params schema.MenuQueryParam, opts ...schema.MenuQueryOptions) (*schema.MenuQueryResult, error)
Query 查询数据
func (*MenuRepo) UpdateParentPath ¶
UpdateParentPath 更新父级路径
type SchemaMenu ¶
SchemaMenu 菜单对象
type SchemaMenuAction ¶
type SchemaMenuAction schema.MenuAction
SchemaMenuAction 菜单动作
func (SchemaMenuAction) ToMenuAction ¶
func (a SchemaMenuAction) ToMenuAction() *MenuAction
ToMenuAction 转换为菜单动作实体
type SchemaMenuActionResource ¶
type SchemaMenuActionResource schema.MenuActionResource
SchemaMenuActionResource 菜单动作关联资源
func (SchemaMenuActionResource) ToMenuActionResource ¶
func (a SchemaMenuActionResource) ToMenuActionResource() *MenuActionResource
ToMenuActionResource 转换为菜单动作关联资源实体