resource

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 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 Repo

type Repo interface {
	// GetResourceScopes 获取资源权限
	GetResourceScopes(ctx kratosx.Context, userId uint32, keyword string) (bool, []uint32, error)
	// UpdateResourceScopes 更新资源权限
	UpdateResourceScopes(ctx kratosx.Context, userId uint32, req []*Resource) error
}

type Resource

type Resource struct {
	Keyword      string `json:"keyword"`
	DepartmentId uint32 `json:"departmentId"`
	ResourceId   uint32 `json:"resourceId"`
}

type UpdateResourceScopesRequest

type UpdateResourceScopesRequest struct {
	Keyword    string   `json:"keyword"`
	Scopes     []uint32 `json:"scopes"`
	ResourceId uint32   `json:"resourceId"`
}

type UseCase

type UseCase struct {
	// contains filtered or unexported fields
}

func NewUseCase

func NewUseCase(config *conf.Config) *UseCase

func (*UseCase) GetResourceScopes

func (u *UseCase) GetResourceScopes(ctx kratosx.Context, keyword string) (bool, []uint32, error)

GetResourceScopes 获取指定用户的资源权限

func (*UseCase) UpdateResourceScopes

func (u *UseCase) UpdateResourceScopes(ctx kratosx.Context, req *UpdateResourceScopesRequest) error

UpdateResourceScopes 更新指定用户的资源权限

Jump to

Keyboard shortcuts

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