service

package
v3.0.0-...-e0c4818 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterContext

func RegisterContext(i IContext)

func RegisterGToken

func RegisterGToken(gtk IGfToken)

func RegisterMiddleware

func RegisterMiddleware(i IMiddleware)

func RegisterOperateLog

func RegisterOperateLog(i IOperateLog)

func RegisterPersonal

func RegisterPersonal(i IPersonal)

func RegisterSysAuthRule

func RegisterSysAuthRule(i ISysAuthRule)

func RegisterSysDept

func RegisterSysDept(i ISysDept)

func RegisterSysLoginLog

func RegisterSysLoginLog(i ISysLoginLog)

func RegisterSysPost

func RegisterSysPost(i ISysPost)

func RegisterSysRole

func RegisterSysRole(i ISysRole)

func RegisterSysUser

func RegisterSysUser(i ISysUser)

func RegisterSysUserOnline

func RegisterSysUserOnline(i ISysUserOnline)

func RegisterTaskList

func RegisterTaskList(i ITaskList)

Types

type IContext

type IContext interface {
	Init(r *ghttp.Request, customCtx *model.Context)
	Get(ctx context.Context) *model.Context
	SetUser(ctx context.Context, ctxUser *model.ContextUser)
	GetLoginUser(ctx context.Context) *model.ContextUser
	GetUserId(ctx context.Context) uint64
}

func Context

func Context() IContext

type IGfToken

type IGfToken interface {
	GenerateToken(ctx context.Context, key string, data interface{}) (keys string, err error)
	Middleware(group *ghttp.RouterGroup) error
	ParseToken(r *ghttp.Request) (*gftoken.CustomClaims, error)
	IsLogin(r *ghttp.Request) (b bool, failed *gftoken.AuthFailed)
	GetRequestToken(r *ghttp.Request) (token string)
	RemoveToken(ctx context.Context, token string) (err error)
	GetTokenData(ctx context.Context, token string) (tData *gftoken.TokenData, key string, err error)
}

func GfToken

func GfToken() IGfToken

type IMiddleware

type IMiddleware interface {
	Ctx(r *ghttp.Request)
	Auth(r *ghttp.Request)
}

func Middleware

func Middleware() IMiddleware

type IOperateLog

type IOperateLog interface {
	OperationLog(r *ghttp.Request)
	Invoke(ctx context.Context, data *model.SysOperLogAdd)
	List(ctx context.Context, req *system.SysOperLogSearchReq) (listRes *system.SysOperLogSearchRes, err error)
	GetByOperId(ctx context.Context, operId uint64) (res *model.SysOperLogInfoRes, err error)
	DeleteByIds(ctx context.Context, ids []uint64) (err error)
	ClearLog(ctx context.Context) (err error)
}

func OperateLog

func OperateLog() IOperateLog

type IPersonal

type IPersonal interface {
	GetPersonalInfo(ctx context.Context, req *system.PersonalInfoReq) (res *system.PersonalInfoRes, err error)
	EditPersonal(ctx context.Context, req *system.PersonalEditReq) (user *model.LoginUserRes, err error)
	ResetPwdPersonal(ctx context.Context, req *system.PersonalResetPwdReq) (res *system.PersonalResetPwdRes, err error)
}

func Personal

func Personal() IPersonal

type ISysAuthRule

type ISysAuthRule interface {
	GetMenuListSearch(ctx context.Context, req *system.RuleSearchReq) (res []*model.SysAuthRuleInfoRes, err error)
	GetIsMenuList(ctx context.Context) ([]*model.SysAuthRuleInfoRes, error)
	GetMenuList(ctx context.Context) (list []*model.SysAuthRuleInfoRes, err error)
	GetIsButtonList(ctx context.Context) ([]*model.SysAuthRuleInfoRes, error)
	Add(ctx context.Context, req *system.RuleAddReq) (err error)
	BindRoleRule(ctx context.Context, ruleId interface{}, roleIds []uint) (err error)
	Get(ctx context.Context, id uint) (rule *entity.SysAuthRule, err error)
	GetMenuRoles(ctx context.Context, id uint) (roleIds []uint, err error)
	Update(ctx context.Context, req *system.RuleUpdateReq) (err error)
	UpdateRoleRule(ctx context.Context, ruleId uint, roleIds []uint) (err error)
	GetMenuListTree(pid uint, list []*model.SysAuthRuleInfoRes) []*model.SysAuthRuleTreeRes
	DeleteMenuByIds(ctx context.Context, ids []int) (err error)
	FindSonByParentId(list []*model.SysAuthRuleInfoRes, pid uint) []*model.SysAuthRuleInfoRes
}

func SysAuthRule

func SysAuthRule() ISysAuthRule

type ISysDept

type ISysDept interface {
	GetList(ctx context.Context, req *system.DeptSearchReq) (list []*entity.SysDept, err error)
	GetFromCache(ctx context.Context) (list []*entity.SysDept, err error)
	Add(ctx context.Context, req *system.DeptAddReq) (err error)
	Edit(ctx context.Context, req *system.DeptEditReq) (err error)
	Delete(ctx context.Context, id uint64) (err error)
	FindSonByParentId(deptList []*entity.SysDept, deptId uint64) []*entity.SysDept
	GetListTree(pid uint64, list []*entity.SysDept) (deptTree []*model.SysDeptTreeRes)
	GetByDeptId(ctx context.Context, deptId uint64) (dept *entity.SysDept, err error)
}

func SysDept

func SysDept() ISysDept

type ISysLoginLog

type ISysLoginLog interface {
	Invoke(ctx context.Context, data *model.LoginLogParams)
	List(ctx context.Context, req *system.LoginLogSearchReq) (res *system.LoginLogSearchRes, err error)
	DeleteLoginLogByIds(ctx context.Context, ids []int) (err error)
	ClearLoginLog(ctx context.Context) (err error)
}

func SysLoginLog

func SysLoginLog() ISysLoginLog

type ISysPost

type ISysPost interface {
	List(ctx context.Context, req *system.PostSearchReq) (res *system.PostSearchRes, err error)
	Add(ctx context.Context, req *system.PostAddReq) (err error)
	Edit(ctx context.Context, req *system.PostEditReq) (err error)
	Delete(ctx context.Context, ids []int) (err error)
	GetUsedPost(ctx context.Context) (list []*entity.SysPost, err error)
}

func SysPost

func SysPost() ISysPost

type ISysRole

type ISysRole interface {
	GetRoleListSearch(ctx context.Context, req *system.RoleListReq) (res *system.RoleListRes, err error)
	GetRoleList(ctx context.Context) (list []*entity.SysRole, err error)
	AddRoleRule(ctx context.Context, ruleIds []uint, roleId int64) (err error)
	DelRoleRule(ctx context.Context, roleId int64) (err error)
	AddRole(ctx context.Context, req *system.RoleAddReq) (err error)
	Get(ctx context.Context, id uint) (res *entity.SysRole, err error)
	GetFilteredNamedPolicy(ctx context.Context, id uint) (gpSlice []int, err error)
	EditRole(ctx context.Context, req *system.RoleEditReq) (err error)
	DeleteByIds(ctx context.Context, ids []int64) (err error)
}

func SysRole

func SysRole() ISysRole

type ISysUser

type ISysUser interface {
	GetCasBinUserPrefix() string
	NotCheckAuthAdminIds(ctx context.Context) *gset.Set
	GetAdminUserByUsernamePassword(ctx context.Context, req *system.UserLoginReq) (user *model.LoginUserRes, err error)
	GetUserByUsername(ctx context.Context, userName string) (user *model.LoginUserRes, err error)
	GetUserById(ctx context.Context, id uint64) (user *model.LoginUserRes, err error)
	LoginLog(ctx context.Context, params *model.LoginLogParams)
	UpdateLoginInfo(ctx context.Context, id uint64, ip string) (err error)
	GetAdminRules(ctx context.Context, userId uint64) (menuList []*model.UserMenus, permissions []string, err error)
	GetAdminRole(ctx context.Context, userId uint64, allRoleList []*entity.SysRole) (roles []*entity.SysRole, err error)
	GetAdminRoleIds(ctx context.Context, userId uint64) (roleIds []uint, err error)
	GetAllMenus(ctx context.Context) (menus []*model.UserMenus, err error)
	GetAdminMenusByRoleIds(ctx context.Context, roleIds []uint) (menus []*model.UserMenus, err error)
	GetMenusTree(menus []*model.UserMenus, pid uint) []*model.UserMenus
	GetPermissions(ctx context.Context, roleIds []uint) (userButtons []string, err error)
	List(ctx context.Context, req *system.UserSearchReq) (total interface{}, userList []*entity.SysUser, err error)
	GetUsersRoleDept(ctx context.Context, userList []*entity.SysUser) (users []*model.SysUserRoleDeptRes, err error)
	Add(ctx context.Context, req *system.UserAddReq) (err error)
	Edit(ctx context.Context, req *system.UserEditReq) (err error)
	AddUserPost(ctx context.Context, tx gdb.TX, postIds []int64, userId int64) (err error)
	EditUserRole(ctx context.Context, roleIds []int64, userId int64) (err error)
	UserNameOrMobileExists(ctx context.Context, userName, mobile string, id ...int64) error
	GetEditUser(ctx context.Context, id uint64) (res *system.UserGetEditRes, err error)
	GetUserInfoById(ctx context.Context, id uint64, withPwd ...bool) (user *entity.SysUser, err error)
	GetUserPostIds(ctx context.Context, userId uint64) (postIds []int64, err error)
	ResetUserPwd(ctx context.Context, req *system.UserResetPwdReq) (err error)
	ChangeUserStatus(ctx context.Context, req *system.UserStatusReq) (err error)
	Delete(ctx context.Context, ids []int) (err error)
	GetUsers(ctx context.Context, ids []int) (users []*model.SysUserSimpleRes, err error)
}

func SysUser

func SysUser() ISysUser

type ISysUserOnline

type ISysUserOnline interface {
	Invoke(ctx context.Context, params *model.SysUserOnlineParams)
	SaveOnline(ctx context.Context, params *model.SysUserOnlineParams)
	CheckUserOnline(ctx context.Context)
	GetOnlineListPage(ctx context.Context, req *system.SysUserOnlineSearchReq, hasToken ...bool) (res *system.SysUserOnlineSearchRes, err error)
	UserIsOnline(ctx context.Context, token string) bool
	DeleteOnlineByToken(ctx context.Context, token string) (err error)
	ForceLogout(ctx context.Context, ids []int) (err error)
	GetInfosByIds(ctx context.Context, ids []int) (onlineList []*entity.SysUserOnline, err error)
}

func SysUserOnline

func SysUserOnline() ISysUserOnline

type ITaskList

type ITaskList interface {
	AddTask(task *model.TimeTask)
	GetByName(funcName string) *model.TimeTask
	EditParams(funcName string, params []string)
}

func TaskList

func TaskList() ITaskList

Jump to

Keyboard shortcuts

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