service

package
v0.0.0-...-14a2a1b Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SysInitConfig map[string]*gvar.Var

Functions

func GfToken

func GfToken() commonService.IGfToken

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 IMiddleware

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

func Middleware

func Middleware() IMiddleware

type IRole

type IRole interface {
	GetRoleList(ctx context.Context) (list []*entity.SysRole, err error)
	GetRoleListSearch(ctx context.Context, req *system.RoleListReq) (res *system.RoleListRes, 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) error
	DeleteByIds(ctx context.Context, ids []int64) (err error)
}

func Role

func Role() IRole

type IRule

type IRule interface {
	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)
	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)
	GetMenuListSearch(ctx context.Context, req *system.RuleSearchReq) (res []*model.SysAuthRuleInfoRes, err error)
	GetMenuListTree(pid uint, list []*model.SysAuthRuleInfoRes) []*model.SysAuthRuleTreeRes
	DeleteMenuByIds(ctx context.Context, ids []int) (err error)
}

func Rule

func Rule() IRule

type ISysInit

type ISysInit interface {
	// 生成配置文件
	CreateConfigFile(ctx context.Context, req *system.DbInitCreateDbReq) (err error)
	// 生成数据库
	CreateDataBase(ctx context.Context, dbName string) (err error)
	// 加载配置文件
	LoadConfigFile() (err error)

	// 是否已生成配置文件
	IsCreateConfigFile() bool

	//创建数据库
	CreateDataBaseByName(ctx context.Context, req *system.DbInitCreateDbReq) (err error)
}

func SysInit

func SysInit() ISysInit

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 IUser

type IUser interface {
	GetAdminUserByUsernamePassword(ctx context.Context, req *system.UserLoginReq) (user *model.LoginUserRes, err error)
	LoginLog(ctx context.Context, params *model.LoginLogParams)
	UpdateLoginInfo(ctx context.Context, id uint64, ip string) (err error)
	NotCheckAuthAdminIds(ctx context.Context) *gset.Set
	GetAdminRules(ctx context.Context, userId uint64) (menuList []*model.UserMenus, permissions []string, err error)
	List(ctx context.Context, req *system.UserSearchReq) (total int, 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)
	GetEditUser(ctx context.Context, id uint64) (res *system.UserGetEditRes, err error)
	Edit(ctx context.Context, req *system.UserEditReq) (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)
}

func User

func User() IUser

type SqlArr

type SqlArr []string

func (SqlArr) Split

func (arr SqlArr) Split(num int) (result SqlArr)

Directories

Path Synopsis
internal
dao
do

Jump to

Keyboard shortcuts

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