menu_service

package
v0.0.0-...-6c1bb8a Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMenuActionData

type CreateMenuActionData struct {
	MenuId int32  `json:"menu_id"` // 菜单栏ID
	Method string `json:"method"`  // 请求方法
	API    string `json:"api"`     // 请求地址
}

type CreateMenuData

type CreateMenuData struct {
	Pid   int32  // 父类ID
	Name  string // 菜单名称
	Link  string // 链接地址
	Icon  string // 图标
	Level int32  // 菜单类型 1:一级菜单 2:二级菜单
}

type SearchData

type SearchData struct {
	Pid int32 // 父类ID
}

type SearchListActionData

type SearchListActionData struct {
	MenuId int32 `json:"menu_id"` // 菜单栏ID
}

type SearchOneData

type SearchOneData struct {
	Id     int32 // 用户ID
	IsUsed int32 // 是否启用 1:是  -1:否
}

type Service

type Service interface {
	Create(ctx core.Context, menuData *CreateMenuData) (id int32, err error)
	Modify(ctx core.Context, id int32, menuData *UpdateMenuData) (err error)
	List(ctx core.Context, searchData *SearchData) (listData []*menu_repo.Menu, err error)
	UpdateUsed(ctx core.Context, id int32, used int32) (err error)
	UpdateSort(ctx core.Context, id int32, sort int32) (err error)
	Delete(ctx core.Context, id int32) (err error)
	Detail(ctx core.Context, searchOneData *SearchOneData) (info *menu_repo.Menu, err error)

	CreateAction(ctx core.Context, menuActionData *CreateMenuActionData) (id int32, err error)
	ListAction(ctx core.Context, searchListActionData *SearchListActionData) (listData []*menu_action_repo.MenuAction, err error)
	DeleteAction(ctx core.Context, id int32) (err error)
	// contains filtered or unexported methods
}

func New

func New(db db.Repo, cache cache.Repo) Service

type UpdateMenuData

type UpdateMenuData struct {
	Name string // 菜单名称
	Link string // 链接地址
	Icon string // 图标
}

Jump to

Keyboard shortcuts

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