service

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeAdminRole      = "admin"    // 管理员角色
	NodeMemberRole     = "member"   // 普通成员角色
	NodeStatusActive   = "active"   // 活跃状态
	NodeStatusInactive = "inactive" // 非活跃状态
	NodeStatusDeleted  = "deleted"  // 删除状态

	// 默认值
	DefaultLevel  = 1
	DefaultStatus = NodeStatusActive
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TreeLocalService

type TreeLocalService interface {
	GetTreeLocalList(ctx context.Context, req *model.GetTreeLocalResourceListReq) (model.ListResp[*model.TreeLocalResource], error)
	GetTreeLocalDetail(ctx context.Context, req *model.GetTreeLocalResourceDetailReq) (*model.TreeLocalResource, error)
	GetTreeLocalForConnection(ctx context.Context, req *model.GetTreeLocalResourceDetailReq) (*model.TreeLocalResource, error)
	CreateTreeLocal(ctx context.Context, req *model.CreateTreeLocalResourceReq) error
	UpdateTreeLocal(ctx context.Context, req *model.UpdateTreeLocalResourceReq) error
	DeleteTreeLocal(ctx context.Context, req *model.DeleteTreeLocalResourceReq) error
	BindTreeLocal(ctx context.Context, req *model.BindTreeLocalResourceReq) error
	UnBindLocalResource(ctx context.Context, req *model.UnBindTreeLocalResourceReq) error
}

func NewTreeLocalService

func NewTreeLocalService(logger *zap.Logger, dao dao.TreeLocalDAO) TreeLocalService

type TreeNodeService

type TreeNodeService interface {
	// 树结构相关接口
	GetTreeList(ctx context.Context, req *model.GetTreeNodeListReq) (model.ListResp[*model.TreeNode], error)
	GetNodeDetail(ctx context.Context, id int) (*model.TreeNode, error)
	GetChildNodes(ctx context.Context, parentID int) ([]*model.TreeNode, error)
	GetTreeStatistics(ctx context.Context) (*model.TreeNodeStatisticsResp, error)

	// 节点管理接口
	CreateNode(ctx context.Context, req *model.CreateTreeNodeReq) error
	UpdateNode(ctx context.Context, req *model.UpdateTreeNodeReq) error
	DeleteNode(ctx context.Context, id int) error
	MoveNode(ctx context.Context, nodeId, newParentId int) error

	// 资源绑定接口
	BindResource(ctx context.Context, req *model.BindTreeNodeResourceReq) error
	UnbindResource(ctx context.Context, req *model.UnbindTreeNodeResourceReq) error

	// 成员管理接口
	GetNodeMembers(ctx context.Context, nodeId int, memberType string) (model.ListResp[*model.User], error)
	AddNodeMember(ctx context.Context, req *model.AddTreeNodeMemberReq) error
	RemoveNodeMember(ctx context.Context, req *model.RemoveTreeNodeMemberReq) error
}

func NewTreeNodeService

func NewTreeNodeService(logger *zap.Logger, dao dao.TreeNodeDAO, userDao userDao.UserDAO) TreeNodeService

Jump to

Keyboard shortcuts

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