menu

package
v8.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MenuActionResourceSet = wire.NewSet(wire.Struct(new(MenuActionResourceRepo), "*"))
View Source
var MenuActionSet = wire.NewSet(wire.Struct(new(MenuActionRepo), "*"))
View Source
var MenuSet = wire.NewSet(wire.Struct(new(MenuRepo), "*"))

Functions

func GetMenuActionDB

func GetMenuActionDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

func GetMenuActionResourceDB

func GetMenuActionResourceDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

func GetMenuDB

func GetMenuDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

Types

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:""`                                   // 创建人
}
func (a Menu) ToSchemaMenu() *schema.Menu
type MenuAction struct {
	util.Model
	MenuID uint64 `gorm:"index;not null;"` // 菜单ID
	Code   string `gorm:"size:100;"`       // 动作编号
	Name   string `gorm:"size:100;"`       // 动作名称
}
func (a MenuAction) ToSchemaMenuAction() *schema.MenuAction
type MenuActionRepo struct {
	DB *gorm.DB
}
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) Update(ctx context.Context, id uint64, item schema.MenuAction) error
type MenuActionResource struct {
	util.Model
	ActionID uint64 `gorm:"index;not null;"` // 菜单动作ID
	Method   string `gorm:"size:50;"`        // 资源请求方式(支持正则)
	Path     string `gorm:"size:255;"`       // 资源请求路径(支持/:id匹配)
}
func (a MenuActionResource) ToSchemaMenuActionResource() *schema.MenuActionResource
type MenuActionResourceRepo struct {
	DB *gorm.DB
}
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
type MenuActionResources []*MenuActionResource
func (a MenuActionResources) ToSchemaMenuActionResources() []*schema.MenuActionResource
type MenuActions []*MenuAction
func (a MenuActions) ToSchemaMenuActions() []*schema.MenuAction
type MenuRepo struct {
	DB *gorm.DB
}
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) 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 []*Menu
func (a Menus) ToSchemaMenus() []*schema.Menu

type SchemaMenu

type SchemaMenu schema.Menu

func (SchemaMenu) ToMenu

func (a SchemaMenu) ToMenu() *Menu

type SchemaMenuAction

type SchemaMenuAction schema.MenuAction

func (SchemaMenuAction) ToMenuAction

func (a SchemaMenuAction) ToMenuAction() *MenuAction

type SchemaMenuActionResource

type SchemaMenuActionResource schema.MenuActionResource

func (SchemaMenuActionResource) ToMenuActionResource

func (a SchemaMenuActionResource) ToMenuActionResource() *MenuActionResource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL