menu

package
v0.0.0-...-3fb8480 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Menu struct {
	ID         string
	Name       string
	Sequence   int
	Icon       string
	Router     string
	ParentID   string
	ParentPath string
	ShowStatus int
	Status     int
	Memo       string
	Creator    string
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  *time.Time
	Actions    menuaction.MenuActions
}
type Menus []*Menu
func (a Menus) FillMenuAction(mActions map[string]menuaction.MenuActions) Menus
func (a Menus) SplitParentIDs() []string

type QueryParam

type QueryParam struct {
	PaginationParam  pagination.Param
	OrderFields      pagination.OrderFields
	IDs              []string
	Name             string
	PrefixParentPath string
	QueryValue       string
	ParentID         *string
	ShowStatus       int
	Status           int
}

type Repository

type Repository interface {
	Query(ctx context.Context, params QueryParam) (Menus, *pagination.Pagination, error)
	Get(ctx context.Context, id string) (*Menu, error)
	Create(ctx context.Context, item *Menu) error
	Update(ctx context.Context, id string, item *Menu) error
	UpdateParentPath(ctx context.Context, id, parentPath string) error
	Delete(ctx context.Context, id string) error
	UpdateStatus(ctx context.Context, id string, status int) error
}

type Service

type Service interface {
	Query(ctx context.Context, params QueryParam) (Menus, *pagination.Pagination, error)
	Get(ctx context.Context, id string) (*Menu, error)
	QueryActions(ctx context.Context, id string) (menuaction.MenuActions, error)
	Create(ctx context.Context, item *Menu) (string, error)
	Update(ctx context.Context, id string, item *Menu) error
	Delete(ctx context.Context, id string) error
	UpdateStatus(ctx context.Context, id string, status int) error
}

func NewService

func NewService(
	transRepo trans.Repository,
	menuRepo Repository,
	menuActionRepo menuaction.Repository,
	menuActionResourceRepo menuactionresource.Repository,
) Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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