category

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCategoryData

type CreateCategoryData struct {
	Pid   int32  // 父类ID
	Name  string // 分类名称
	Icon  string // 图标库 https://lineicons.com/icons/
	Level int32
}

type SearchData

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

type SearchOneData

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

type Service

type Service interface {
	List(ctx core.Context, searchData *SearchData) (listData []*category.Category, err error)
	Tree(ctx core.Context) (nodes []*TreeNode, err error)
	Create(ctx core.Context, siteData *CreateCategoryData) (id int32, err error)
	Modify(ctx core.Context, id int32, menuData *UpdateCategoryData) (err error)
	Delete(ctx core.Context, id int32) error
	Detail(ctx core.Context, searchOneData *SearchOneData) (info *category.Category, err error)
	UpdateUsed(ctx core.Context, id int32, used int32) (err error)
	UpdateSort(ctx core.Context, id int32, sort int32) (err error)
	// contains filtered or unexported methods
}

func New

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

type TreeNode

type TreeNode struct {

	// Id 节点ID
	Id int32
	// Pid 父节点ID
	Pid int32
	// Name 节点名称
	Name string
	// Icon 图标
	Icon string
	// Child 获取子节点切片
	Child []*TreeNode
}

type UpdateCategoryData

type UpdateCategoryData struct {
	Name string // 菜单名称
	Icon string // 图标
}

Jump to

Keyboard shortcuts

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