sys

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleRoleMGR  wa.Role = 1 << iota // 角色管理员
	RoleGroupMGR                     // 组别管理员
	RoleUserMGR                      // 用户管理员
	RoleTokenMGR                     // 令牌管理员
)

Roles.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupBIZ

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

GroupBIZ represents the group BIZ.

func NewGroupBIZ

func NewGroupBIZ(config *wa.Config, groupDAO wa.GroupDAO) *GroupBIZ

NewGroupBIZ creates a new group BIZ.

func (*GroupBIZ) Create

func (a *GroupBIZ) Create(session wa.Session, group *wa.Group) (*wa.Group, error)

Create creates a group.

func (*GroupBIZ) Delete

func (a *GroupBIZ) Delete(session wa.Session, gid wa.ID) error

Delete deletes the group.

func (*GroupBIZ) Get

func (a *GroupBIZ) Get(session wa.Session, gid wa.ID) (*wa.Group, error)

Get gets the group by id.

func (*GroupBIZ) GetExtra

func (a *GroupBIZ) GetExtra() []string

GetExtra returns the extra fields.

func (*GroupBIZ) GetMainGroup

func (a *GroupBIZ) GetMainGroup(session wa.Session, gid wa.ID) (*wa.Group, error)

GetMainGroup get the main group.

func (*GroupBIZ) Query

func (a *GroupBIZ) Query(session wa.Session, gid wa.ID, keyword string) ([]*wa.Group, error)

Query queries the groups by keyword.

func (*GroupBIZ) Update

func (a *GroupBIZ) Update(session wa.Session, group *wa.Group) error

Update updates the group.

type RoleBIZ

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

RoleBIZ represents the role BIZ.

func NewRoleBIZ

func NewRoleBIZ(moduleMGR *wa.ModuleMGR, roleDAO wa.RoleDAO, userDAO wa.UserDAO) *RoleBIZ

NewRoleBIZ creates a new role BIZ.

func (*RoleBIZ) Get

func (a *RoleBIZ) Get(session wa.Session, mcode string, uid wa.ID) ([]int, error)

Get gets the user role.

func (*RoleBIZ) GetModules

func (a *RoleBIZ) GetModules(session wa.Session) ([]*wa.Module, error)

GetModules returns the modules.

func (*RoleBIZ) Set

func (a *RoleBIZ) Set(session wa.Session, mcode string, uid wa.ID, roles []int) error

Set sets the user role.

type UserBIZ

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

UserBIZ represents the user BIZ.

func NewUserBIZ

func NewUserBIZ(config *wa.Config, sessionMGR *wa.SessionMGR, userDAO wa.UserDAO, roleDAO wa.RoleDAO) *UserBIZ

NewUserBIZ creates a new user BIZ.

func (*UserBIZ) Create

func (a *UserBIZ) Create(session wa.Session, user *wa.User) (*wa.User, error)

Create creates a user.

func (*UserBIZ) Delete

func (a *UserBIZ) Delete(session wa.Session, uid wa.ID) error

Delete deletes the user.

func (*UserBIZ) Get

func (a *UserBIZ) Get(session wa.Session, uid wa.ID) (*wa.User, error)

Get gets the user by id.

func (*UserBIZ) GetExtra

func (a *UserBIZ) GetExtra() []string

GetExtra returns the extra fields.

func (*UserBIZ) Query

func (a *UserBIZ) Query(session wa.Session, gid wa.ID, keyword string) ([]*wa.User, error)

Query queries the users by keyword.

func (*UserBIZ) ResetPassword

func (a *UserBIZ) ResetPassword(session wa.Session, uid wa.ID) (string, error)

ResetPassword resets the user password.

func (*UserBIZ) Update

func (a *UserBIZ) Update(session wa.Session, user *wa.User) error

Update updates the user.

Jump to

Keyboard shortcuts

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