svc

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeptSvc

type DeptSvc struct {
	*svc.Svc[mdl.Dept]
}

部门服务

func NewDeptSvc added in v1.0.0

func NewDeptSvc(i *do.Injector) (*DeptSvc, error)

构造函数

func (*DeptSvc) ListDepts added in v1.0.0

func (s *DeptSvc) ListDepts(conds map[string]any) ([]mdl.Dept, int64, error)

列举部门集合

type DictSvc

type DictSvc struct {
	*svc.Svc[mdl.Dict]
}

字典服务

func NewDictSvc added in v1.0.0

func NewDictSvc(i *do.Injector) (*DictSvc, error)

构造函数

type IJob added in v1.0.0

type IJob interface {
	cron.Job
	SetParams(params string) // 设置参数集合
}

作业接口

type JobSvc added in v1.0.0

type JobSvc struct {
	*svc.Svc[mdl.Job]
	Jobs map[string]IJob // 作业集合
	// contains filtered or unexported fields
}

作业服务

func NewJobSvc added in v1.0.0

func NewJobSvc(i *do.Injector) (*JobSvc, error)

构造函数

func (*JobSvc) StartJob added in v1.0.0

func (s *JobSvc) StartJob(id int64) error

启动作业

func (*JobSvc) StopJob added in v1.0.0

func (s *JobSvc) StopJob(id int64) error

停止作业

type ResourceSvc

type ResourceSvc struct {
	*svc.Svc[mdl.Resource]
	// contains filtered or unexported fields
}

资源服务

func NewResourceSvc added in v1.0.0

func NewResourceSvc(i *do.Injector) (*ResourceSvc, error)

构造函数

func (*ResourceSvc) ListMenus added in v1.0.0

func (s *ResourceSvc) ListMenus(userId string) ([]mdl.Resource, error)

列举菜单集合

func (*ResourceSvc) ListResources added in v1.0.0

func (s *ResourceSvc) ListResources(conds map[string]any) ([]mdl.Resource, int64, error)

列举资源集合

type RoleSvc

type RoleSvc struct {
	*svc.Svc[mdl.Role]
	// contains filtered or unexported fields
}

角色服务

func NewRoleSvc added in v1.0.0

func NewRoleSvc(i *do.Injector) (*RoleSvc, error)

构造函数

func (*RoleSvc) ListRoleResources added in v1.0.0

func (s *RoleSvc) ListRoleResources(id string) ([]int64, error)

列举角色资源集合

func (*RoleSvc) SaveRoleResources added in v1.0.0

func (s *RoleSvc) SaveRoleResources(id string, resources []mdl.Resource) error

保存角色资源集合

type ServerSvc

type ServerSvc struct {
}

服务器服务

func NewServerSvc added in v1.0.0

func NewServerSvc(i *do.Injector) (*ServerSvc, error)

构造函数

func (*ServerSvc) GetServer added in v1.0.0

func (s *ServerSvc) GetServer() mdl.Server

获取服务器

type UpgradeSvc

type UpgradeSvc struct {
}

升级服务

func NewUpgradeSvc added in v1.0.0

func NewUpgradeSvc(i *do.Injector) (*UpgradeSvc, error)

构造函数

func (*UpgradeSvc) Upgrade added in v1.0.0

func (s *UpgradeSvc) Upgrade(ver string) (string, string, error)

升级

type UserSvc

type UserSvc struct {
	*svc.Svc[mdl.User]
	Perm      *casbin.SyncedEnforcer // 权限
	SignedKey []byte                 // 签名密钥
}

用户服务

func NewUserSvc added in v1.0.0

func NewUserSvc(i *do.Injector) (*UserSvc, error)

构造函数

func (*UserSvc) ListUserRoles added in v1.0.0

func (s *UserSvc) ListUserRoles(id string) ([]int64, error)

列举用户角色集合

func (*UserSvc) ListUsers added in v1.0.0

func (s *UserSvc) ListUsers(conds map[string]any) ([]mdl.User, int64, error)

列举用户集合

func (*UserSvc) Login added in v1.0.0

func (s *UserSvc) Login(userName, password string) (*mdl.User, error)

登录

func (*UserSvc) RemoveUsers added in v1.0.0

func (s *UserSvc) RemoveUsers(ids []string) error

移除用户集合

func (*UserSvc) SaveUser added in v1.0.0

func (s *UserSvc) SaveUser(user mdl.User) error

保存用户角色集合

func (*UserSvc) SaveUserRoles added in v1.0.0

func (s *UserSvc) SaveUserRoles(id string, roles []int64) error

保存用户角色集合

type VisitSvc

type VisitSvc struct {
	*svc.Svc[mdl.Visit]
}

访问服务

func NewVisitSvc added in v1.0.0

func NewVisitSvc(i *do.Injector) (*VisitSvc, error)

构造函数

Jump to

Keyboard shortcuts

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