service

package
v0.0.0-...-5961e9c Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CasbinEnforcer

func CasbinEnforcer(ctx context.Context) (enforcer *casbin.SyncedEnforcer, err error)

CasbinEnforcer 获取adapter单例对象

func GfToken

func GfToken() commonService.IGToken

Types

type IConfig

type IConfig interface {
	List(ctx context.Context, req *system.ConfigSearchReq) (res *system.ConfigSearchRes, err error)
	Add(ctx context.Context, req *system.ConfigAddReq, userId uint64) (err error)
	Get(ctx context.Context, id int) (res *system.ConfigGetRes, err error)
	Edit(ctx context.Context, req *system.ConfigEditReq, userId uint64) (err error)
	Delete(ctx context.Context, ids []int) (err error)
}

func Config

func Config() IConfig

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 IDept

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

func Dept

func Dept() IDept

type IDictData

type IDictData interface {
	GetDictWithDataByType(ctx context.Context, req *system.GetDictReq) (dict *system.GetDictRes, err error)
	List(ctx context.Context, req *system.DictDataSearchReq) (res *system.DictDataSearchRes, err error)
	Add(ctx context.Context, req *system.DictDataAddReq, userId uint64) (err error)
	Get(ctx context.Context, dictCode uint) (res *system.DictDataGetRes, err error)
	Edit(ctx context.Context, req *system.DictDataEditReq, userId uint64) (err error)
	Delete(ctx context.Context, ids []int) (err error)
}

func DictData

func DictData() IDictData

type IDictType

type IDictType interface {
	List(ctx context.Context, req *system.DictTypeSearchReq) (res *system.DictTypeSearchRes, err error)
	Add(ctx context.Context, req *system.DictTypeAddReq, userId uint64) (err error)
	Get(ctx context.Context, req *system.DictTypeGetReq) (dictType *entity.SysDictType, err error)
	Edit(ctx context.Context, req *system.DictTypeEditReq, userId uint64) (err error)
	Delete(ctx context.Context, dictIds []int) (err error)
}

func DictType

func DictType() IDictType

type IGenTableColumn

type IGenTableColumn interface {
	SelectDbTableColumnsByName(ctx context.Context, tableName string) ([]*entity.SysGenTableColumn, error)
	InitColumnField(column *entity.SysGenTableColumn, table *entity.SysGenTable)
	GetDbType(columnType string) string
	IsExistInArray(value string, array []string) bool
	GetColumnLength(columnType string) int
	IsStringObject(dataType string) bool
	IsTimeObject(dataType string) bool
	IsNumberObject(dataType string) bool
	IsNotEdit(name string) bool
	IsNotList(name string) bool
	IsNotQuery(name string) bool
	CheckNameColumn(columnName string) bool
	CheckStatusColumn(columnName string) bool
	CheckTypeColumn(columnName string) bool
	CheckSexColumn(columnName string) bool
	SelectGenTableColumnListByTableId(ctx context.Context, tableId int64) (list []*entity.SysGenTableColumn, err error)
	GetAllTableColumns(ctx context.Context) (list []*model.SysGenTableColumn, err error)
	SetPkColumn(table *sysModel.SysGenTableEntityExtend, columns []*entity.SysGenTableColumn)
}

func GenTableColumn

func GenTableColumn() IGenTableColumn

type IMiddleware

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

func Middleware

func Middleware() IMiddleware

type IPost

type IPost 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 Post

func Post() IPost

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 ISysGenTable

type ISysGenTable interface {
	SelectListByPage(ctx context.Context, req *system.GenTableSearchReq) (total int, list []*entity.SysGenTable, err error)
	SelectDbTableList(ctx context.Context, req *system.GenDbSearchReq) (res *system.GenDbSearchRes, err error)
	SelectDbTableListByNames(ctx context.Context, tableNames []string) ([]*entity.SysGenTable, error)
	ImportGenTable(ctx context.Context, tableList []*entity.SysGenTable) error
	Delete(ctx context.Context, ids []int64) error
	SaveEdit(ctx context.Context, req *system.GenTableEditReq) (err error)
	GetTableInfoByTableId(ctx context.Context, tableId int64) (info *entity.SysGenTable, err error)
	GenData(ctx context.Context, tableId int64) (data g.MapStrStr, extendData *model.SysGenTableEntityExtend, err error)
	BatchGenCode(ctx context.Context, tableIds []int64, r *ghttp.Request) (err error)
	GenCode(ctx context.Context, ids []int64) (err error)
}

func SysGenTable

func SysGenTable() ISysGenTable

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 ISysJob

type ISysJob interface {
	List(ctx context.Context, req *system.SysJobSearchReq) (total, page int, list []*entity.SysJob, err error)
	Get(ctx context.Context, id int64) (info *entity.SysJob, err error)
	Add(ctx context.Context, req *system.SysJobAddReq) (err error)
	Edit(ctx context.Context, req *system.SysJobEditReq) error
	DeleteByIds(ctx context.Context, ids []int) (err error)
	ChangeStatus(ctx context.Context, req *system.SysJobStatusReq) error
}

type job struct { } var SysJob = new(job)

func SysJob

func SysJob() ISysJob

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)

Jump to

Keyboard shortcuts

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