Documentation
¶
Index ¶
- type Address
- type App
- type AppField
- type AppOAuther
- type Authorize
- type Dept
- type DeptRole
- type Dictionary
- type Entity
- type Feedback
- type Field
- type Job
- type JobRole
- type Log
- type Menu
- type OAuthExecer
- type OAuther
- type OAutherFunc
- type Role
- type RoleEntity
- type RoleMenu
- type Scope
- type Tenant
- type TenantAdmin
- type TenantApp
- type User
- type UserDept
- type UserOAuther
- type UserSetting
- type Userinfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface {
// GetApp 获取指定的应用信息
GetApp(ctx core.Context, id uint32) (*entity.App, error)
// GetAppByKeyword 获取指定的应用信息
GetAppByKeyword(keyword string) (*entity.App, error)
// ListApp 获取应用信息列表
ListApp(ctx core.Context, req *types.ListAppRequest) ([]*entity.App, uint32, error)
// CreateApp 创建应用信息
CreateApp(ctx core.Context, req *entity.App) (uint32, error)
// UpdateApp 更新应用信息
UpdateApp(ctx core.Context, req *entity.App) error
// DeleteApp 删除应用信息
DeleteApp(ctx core.Context, id uint32) error
}
type AppField ¶ added in v1.2.8
type AppField interface {
// GetAppFields 获取应用字段列表
GetAppFields(ctx core.Context, appId uint32) ([]string, error)
// ListAppField 获取应用字段列表
ListAppField(ctx core.Context, req *types.ListAppFieldRequest) ([]*entity.AppField, uint32, error)
// CreateAppField 创建应用字段信息
CreateAppField(ctx core.Context, req *entity.AppField) (uint32, error)
// UpdateAppField 更新应用字段信息
UpdateAppField(ctx core.Context, req *entity.AppField) error
// DeleteAppField 删除应用字段信息
DeleteAppField(ctx core.Context, id uint32) error
}
type AppOAuther ¶ added in v1.2.8
type AppOAuther interface {
// ListAppOAuther 获取应用授权列表
ListAppOAuther(ctx core.Context, req *types.ListAppOAutherRequest) ([]*entity.AppOAuther, uint32, error)
// GetAppOAutherByAT 获取应用信息
GetAppOAutherByAT(ctx core.Context, appId uint32, tp string) (*entity.AppOAuther, error)
// CreateAppOAuther 创建应用信息
CreateAppOAuther(ctx core.Context, req *entity.AppOAuther) (uint32, error)
// DeleteAppOAuther 删除应用信息
DeleteAppOAuther(ctx core.Context, id uint32) error
}
type Authorize ¶ added in v1.2.8
type Authorize interface {
// GetAuthorize 获取授权列表
GetAuthorize(ctx core.Context, req *types.GetAuthorizeRequest) (*entity.Authorize, error)
// ListAuthorize 获取授权列表
ListAuthorize(ctx core.Context, req *types.ListAuthorizeRequest) ([]*entity.Authorize, uint32, error)
// CreateAuthorize 创建授权
CreateAuthorize(ctx core.Context, req *entity.Authorize) (uint32, error)
// UpdateAuthorize 更新授权
UpdateAuthorize(ctx core.Context, req *entity.Authorize) error
// DeleteAuthorize 删除授权
DeleteAuthorize(ctx core.Context, id uint32) error
}
type Dept ¶
type Dept interface {
// ListDeptClassify 获取部门分类列表
ListDeptClassify(ctx core.Context, req *types.ListDeptClassifyRequest) ([]*entity.DeptClassify, uint32, error)
// CreateDeptClassify 创建部门分类
CreateDeptClassify(ctx core.Context, req *entity.DeptClassify) (uint32, error)
// UpdateDeptClassify 更新部门分类
UpdateDeptClassify(ctx core.Context, req *entity.DeptClassify) error
// DeleteDeptClassify 删除部门分类
DeleteDeptClassify(ctx core.Context, id uint32) error
// GetDept 获取指定的部门信息
GetDept(ctx core.Context, id uint32) (*entity.Dept, error)
// ListDept 获取部门信息列表
ListDept(ctx core.Context, req *types.ListDeptRequest) ([]*entity.Dept, error)
// CreateDept 创建部门信息
CreateDept(ctx core.Context, req *entity.Dept) (uint32, error)
// UpdateDept 更新部门信息
UpdateDept(ctx core.Context, req *entity.Dept) error
// DeleteDept 删除部门信息
DeleteDept(ctx core.Context, id uint32) error
}
type DeptRole ¶
type DeptRole interface {
// ListDeptRole 获取部门角色列表
ListDeptRole(ctx core.Context, req *types.ListDeptRoleRequest) ([]*entity.Role, uint32, error)
// CreateDeptRole 创建部门角色信息
CreateDeptRole(ctx core.Context, deptId, roleId uint32) error
// DeleteDeptRole 删除部门角色信息
DeleteDeptRole(ctx core.Context, deptId, roleId uint32) error
}
type Dictionary ¶
type Dictionary interface {
// ListDictionary 获取字典目录列表
ListDictionary(ctx kratosx.Context, req *types.ListDictionaryRequest) ([]*entity.Dictionary, uint32, error)
// CreateDictionary 创建字典目录
CreateDictionary(ctx kratosx.Context, req *entity.Dictionary) (uint32, error)
// UpdateDictionary 更新字典目录
UpdateDictionary(ctx kratosx.Context, req *entity.Dictionary) error
// DeleteDictionary 删除字典目录
DeleteDictionary(ctx kratosx.Context, id uint32) error
// ListDictionaryValue 获取字典值目录列表
ListDictionaryValue(ctx kratosx.Context, req *types.ListDictionaryValueRequest) ([]*entity.DictionaryValue, uint32, error)
// AllDictionaryValue 获取全部字典值目录列表
AllDictionaryValue(ctx kratosx.Context, req *types.AllDictionaryValueRequest) ([]*entity.DictionaryValue, error)
// GetDictionaryValue 获取字典值
GetDictionaryValue(ctx kratosx.Context, id uint32) (*entity.DictionaryValue, error)
// CreateDictionaryValue 创建字典值目录
CreateDictionaryValue(ctx kratosx.Context, req *entity.DictionaryValue) (uint32, error)
// UpdateDictionaryValue 更新字典值目录
UpdateDictionaryValue(ctx kratosx.Context, req *entity.DictionaryValue) error
// UpdateDictionaryValueStatus 更新字典值目录状态
UpdateDictionaryValueStatus(ctx kratosx.Context, id uint32, status bool) error
// DeleteDictionaryValue 删除字典值目录
DeleteDictionaryValue(ctx kratosx.Context, id uint32) error
// GetDictionary 获取指定的字典目录
GetDictionary(ctx kratosx.Context, id uint32) (*entity.Dictionary, error)
// GetDictionaryByKeyword 获取指定的字典目录
GetDictionaryByKeyword(ctx kratosx.Context, keyword string) (*entity.Dictionary, error)
// ListDictionaryValues 批量获取字典
ListDictionaryValues(ctx kratosx.Context, keywords []string) ([]*types.DictionaryValue, error)
}
type Entity ¶
type Entity interface {
// GetEntityIdByName 查询部门信息
GetEntityIdByName(db string, name string) (uint32, bool)
// GetEntity 查询部门信息
GetEntity(ctx core.Context, id uint32) (*entity.Entity, error)
// ListEntity 获取部门信息列表
ListEntity(ctx core.Context, req *types.ListEntityRequest) ([]*entity.Entity, error)
// CreateEntity 创建部门信息
CreateEntity(ctx core.Context, req *entity.Entity) (uint32, error)
// UpdateEntity 更新部门信息
UpdateEntity(ctx core.Context, req *entity.Entity) error
// DeleteEntity 删除部门信息
DeleteEntity(ctx core.Context, id uint32) error
// ListEntityField 获取部门分类列表
ListEntityField(ctx core.Context, req *types.ListEntityFieldRequest) ([]*entity.EntityField, uint32, error)
// CreateEntityField 创建部门分类
CreateEntityField(ctx core.Context, req *entity.EntityField) (uint32, error)
// UpdateEntityField 更新部门分类
UpdateEntityField(ctx core.Context, req *entity.EntityField) error
// DeleteEntityField 删除部门分类
DeleteEntityField(ctx core.Context, id uint32) error
GetEntityField(ctx core.Context, id uint32, name string) (*entity.EntityField, error)
// ListEntityRule 获取实体规则列表
ListEntityRule(ctx core.Context, req *types.ListEntityRuleRequest) ([]*entity.EntityRule, uint32, error)
// CreateEntityRule 创建实体规则
CreateEntityRule(ctx core.Context, req *entity.EntityRule) (uint32, error)
// UpdateEntityRule 更新实体规则
UpdateEntityRule(ctx core.Context, req *entity.EntityRule) error
// DeleteEntityRule 删除实体规则
DeleteEntityRule(ctx core.Context, id uint32) error
GetEntityRule(ctx core.Context, id uint32, name string) (*entity.EntityRule, error)
}
type Feedback ¶
type Feedback interface {
// ListFeedbackCategory 获取反馈建议分类列表
ListFeedbackCategory(ctx core.Context, req *types.ListFeedbackCategoryRequest) ([]*entity.FeedbackCategory, uint32, error)
// CreateFeedbackCategory 创建反馈建议分类
CreateFeedbackCategory(ctx core.Context, req *entity.FeedbackCategory) (uint32, error)
// UpdateFeedbackCategory 更新反馈建议分类
UpdateFeedbackCategory(ctx core.Context, req *entity.FeedbackCategory) error
// DeleteFeedbackCategory 删除反馈建议分类
DeleteFeedbackCategory(ctx core.Context, id uint32) error
// IsExistFeedbackByMd5 是否存在反馈
IsExistFeedbackByMd5(ctx core.Context, md5 string) bool
// GetFeedback 获取反馈建议
GetFeedback(ctx core.Context, id uint32) (*entity.Feedback, error)
// ListFeedback 获取反馈建议列表
ListFeedback(ctx core.Context, req *types.ListFeedbackRequest) ([]*entity.Feedback, uint32, error)
// CreateFeedback 创建反馈建议
CreateFeedback(ctx core.Context, req *entity.Feedback) (uint32, error)
// DeleteFeedback 删除反馈建议
DeleteFeedback(ctx core.Context, id uint32) error
// UpdateFeedback 更新反馈建议
UpdateFeedback(ctx core.Context, req *entity.Feedback) error
}
type Field ¶
type Field interface {
// ListField 获取用户字段列表
ListField(ctx core.Context, req *types.ListFieldRequest) ([]*entity.Field, uint32, error)
// CreateField 创建用户字段
CreateField(ctx core.Context, req *entity.Field) (uint32, error)
// UpdateField 更新用户字段
UpdateField(ctx core.Context, req *entity.Field) error
// DeleteField 删除用户字段
DeleteField(ctx core.Context, id uint32) error
}
type Job ¶
type Job interface {
// ListJob 获取职位列表
ListJob(ctx core.Context, req *types.ListJobRequest) ([]*entity.Job, uint32, error)
// CreateJob 创建职位
CreateJob(ctx core.Context, req *entity.Job) (uint32, error)
// UpdateJob 更新职位
UpdateJob(ctx core.Context, req *entity.Job) error
// DeleteJob 删除职位
DeleteJob(ctx core.Context, id uint32) error
}
type JobRole ¶
type JobRole interface {
// ListJobRole 获取指定菜单的角色列表
ListJobRole(ctx core.Context, req *types.ListJobRoleRequest) ([]*entity.Role, uint32, error)
// CreateJobRole 创建角色菜单的关联信息
CreateJobRole(ctx core.Context, jobId, roleId uint32) error
// DeleteJobRole 删除角色菜单关联信息
DeleteJobRole(ctx core.Context, jobId, roleId uint32) error
}
type Log ¶ added in v1.2.8
type Log interface {
// ListLoginLog 获取登陆日志
ListLoginLog(ctx core.Context, req *types.ListLoginLogRequest) ([]*entity.LoginLog, uint32, error)
// CreateLoginLog 创建登陆日志
CreateLoginLog(ctx core.Context, log *entity.LoginLog) (uint32, error)
// ListAuthLog 获取鉴权日志
ListAuthLog(ctx core.Context, req *types.ListAuthLogRequest) ([]*entity.AuthLog, uint32, error)
// CreateAuthLog 创建鉴权日志
CreateAuthLog(ctx core.Context, log *entity.AuthLog) (uint32, error)
}
type Menu ¶
type Menu interface {
GetMenuIdsByAppId(ctx core.Context, id uint32) ([]uint32, error)
// GetMenu 获取菜单列表
GetMenu(ctx core.Context, id uint32) (*entity.Menu, error)
// ListMenu 获取菜单信息列表
ListMenu(ctx core.Context, req *types.ListMenuRequest) ([]*entity.Menu, error)
// GetMenuChildrenIds 获取指定目录下的id
GetMenuChildrenIds(ctx core.Context, id uint32) ([]uint32, error)
// CreateMenu 创建菜单信息
CreateMenu(ctx core.Context, req *entity.Menu) (uint32, error)
// UpdateMenu 更新菜单信息
UpdateMenu(ctx core.Context, req *entity.Menu) error
// DeleteMenu 删除菜单信息
DeleteMenu(ctx core.Context, id uint32) error
// SetHome 设置菜单首页
SetHome(ctx core.Context, id uint32) error
GetCacheMenu(api string, method string) (*types.CacheMenu, bool)
}
type OAuthExecer ¶ added in v1.2.8
type OAuthExecer interface {
// ListOAutherType 获取授权列表类型
ListOAutherType() []*types.OAutherType
// GetOAuther 获取授权器
GetOAuther(req *entity.OAuther) (OAutherFunc, error)
}
type OAuther ¶ added in v1.2.8
type OAuther interface {
// GetOAutherByKeyword 获取指定的登陆渠道
GetOAutherByKeyword(ctx core.Context, tid uint32, keyword string) (*entity.OAuther, error)
// GetOAuther 获取指定的登陆渠道
GetOAuther(ctx core.Context, id uint32) (*entity.OAuther, error)
// ListOAuther 获取登陆渠道列表
ListOAuther(ctx core.Context, req *types.ListOAutherRequest) ([]*entity.OAuther, uint32, error)
// CreateOAuther 创建登陆渠道
CreateOAuther(ctx core.Context, req *entity.OAuther) (uint32, error)
// UpdateOAuther 更新登陆渠道
UpdateOAuther(ctx core.Context, req *entity.OAuther) error
// DeleteOAuther 删除登陆渠道
DeleteOAuther(ctx core.Context, id uint32) error
}
type OAutherFunc ¶ added in v1.2.8
type OAutherFunc interface {
// Handler 授权处理
Handler(core.Context, *types.OAutherHandleRequest) (*types.OAutherHandleReply, error)
// GetToken 获取授权token
GetToken(core.Context, *types.OAutherTokenRequest) (*types.OAutherTokenReply, error)
// GetInfo 获取授权信息
GetInfo(core.Context, *types.OAutherInfoRequest) (*types.OAutherInfoReply, error)
}
type Role ¶
type Role interface {
// GetRoleChildrenIds 获取指定觉得的下级所有角色id
GetRoleChildrenIds(ctx core.Context, ids []uint32) ([]uint32, error)
// GetRoleParentIds 获取指定觉得的下级所有角色id
GetRoleParentIds(ctx core.Context, ids []uint32) ([]uint32, error)
// GetRoleByKeyword 获取指定的部门信息
GetRoleByKeyword(ctx core.Context, keyword string) (*entity.Role, error)
// GetRole 获取指定的部门信息
GetRole(ctx core.Context, id uint32) (*entity.Role, error)
// ListRole 获取部门信息列表
ListRole(ctx core.Context, req *types.ListRoleRequest) ([]*entity.Role, error)
// CreateRole 创建部门信息
CreateRole(ctx core.Context, req *entity.Role) (uint32, error)
// UpdateRole 更新部门信息
UpdateRole(ctx core.Context, req *entity.Role) error
// DeleteRole 删除部门信息
DeleteRole(ctx core.Context, id uint32) error
}
type RoleEntity ¶
type RoleEntity interface {
// ListRoleEntity 获取部门信息列表
ListRoleEntity(ctx core.Context, req *types.ListRoleEntityRequest) ([]*entity.RoleEntity, uint32, error)
// CreateRoleEntity 创建部门信息
CreateRoleEntity(ctx core.Context, req *entity.RoleEntity) (uint32, error)
// UpdateRoleEntity 更新部门信息
UpdateRoleEntity(ctx core.Context, req *entity.RoleEntity) error
// DeleteRoleEntity 删除部门信息
DeleteRoleEntity(ctx core.Context, id uint32) error
}
type RoleMenu ¶
type RoleMenu interface {
// CreateRoleMenus 创建角色菜单的关联信息
CreateRoleMenus(ctx core.Context, rms []*entity.RoleMenu) error
// DeleteRoleMenus 删除角色菜单关联信息
DeleteRoleMenus(ctx core.Context, rms []*entity.RoleMenu) error
// GetMenuIdsByRoleIds 获取角色id
GetMenuIdsByRoleIds(mids []uint32) []uint32
// GetRoleIdsByMenuIds 获取菜单id
GetRoleIdsByMenuIds(rids []uint32) []uint32
// DeleteRoles 批量删除角色
DeleteRoles(ctx core.Context, rids []uint32) error
// DeleteMenus 批量删除菜单
DeleteMenus(ctx core.Context, rids []uint32) error
}
type Scope ¶
type Scope interface {
GetScope(ctx core.Context, database string, entity string, action string) *types.GetScopeResponse
HasMenuScope(ctx core.Context, menuId uint32) bool
HasAppScope(ctx core.Context, roleId uint32) bool
// HasRoleScope 判断是否具有角色权限
HasRoleScope(ctx core.Context, roleId uint32) bool
// RoleScopes 获取应用的权限列表
RoleScopes(ctx core.Context) []uint32
// SystemDeptScopes 获取当前系统的部门权限
SystemDeptScopes(ctx core.Context, entity string, action string) (bool, []uint32)
// DeptScopes 获取部门的权限列表
DeptScopes(ctx core.Context, database, entity, action string) (bool, []uint32)
// RoleIds 用户当前用户的角色列表
RoleIds(ctx core.Context) []uint32
// DeptIds 获取当前用户的部门列表
DeptIds(ctx core.Context) []uint32
}
type Tenant ¶
type Tenant interface {
// GetTenant 获取指定的租户
GetTenant(ctx core.Context, id uint32) (*entity.Tenant, error)
// GetTenantByKeyword 获取指定的租户
GetTenantByKeyword(ctx core.Context, keyword string) (*entity.Tenant, error)
// ListTenant 获取租户列表
ListTenant(ctx core.Context, req *types.ListTenantRequest) ([]*entity.Tenant, uint32, error)
// CreateTenant 创建租户
CreateTenant(ctx core.Context, req *entity.Tenant) (uint32, error)
// UpdateTenant 更新租户
UpdateTenant(ctx core.Context, req *entity.Tenant) error
// DeleteTenant 删除租户
DeleteTenant(ctx core.Context, id uint32) error
}
type TenantAdmin ¶ added in v1.2.8
type TenantAdmin interface {
// GetAdminIds 获取租户管理员ID列表
GetAdminIds(tid uint32) []uint32
// IsAdmin 判断用户是否为租户管理员
IsAdmin(tid uint32, uid uint32) bool
// ListTenantAdmin 获取租户管理员列表
ListTenantAdmin(ctx core.Context, req *types.ListTenantAdminRequest) ([]*entity.TenantAdmin, uint32, error)
// CreateTenantAdmin 创建租户管理员
CreateTenantAdmin(ctx core.Context, req *entity.TenantAdmin) (uint32, error)
// DeleteTenantAdmin 删除租户管理员
DeleteTenantAdmin(ctx core.Context, req *types.DeleteTenantAdminRequest) error
}
type TenantApp ¶
type TenantApp interface {
// GetAppIds 获取租户应用ID列表
GetAppIds(tid uint32) []uint32
// GetTenantApp 获取租户应用
GetTenantApp(ctx core.Context, req *types.GetTenantAppRequest) (*entity.TenantApp, error)
// ListTenantApp 获取租户应用列表
ListTenantApp(ctx core.Context, req *types.ListTenantAppRequest) ([]*entity.TenantApp, uint32, error)
// CreateTenantApp 创建租户应用
CreateTenantApp(ctx core.Context, req *entity.TenantApp) (uint32, error)
// UpdateTenantApp 更新租户应用
UpdateTenantApp(ctx core.Context, req *entity.TenantApp) error
// DeleteTenantApp 删除租户应用
DeleteTenantApp(ctx core.Context, tid uint32, aid uint32) error
// GetTenantMenuIds 获取租户的菜单ids
GetTenantMenuIds(tid uint32) []uint32
// GetTenantAppMenuIds 获取租户应用的菜单ids
GetTenantAppMenuIds(ctx core.Context, tid uint32, aid uint32) ([]uint32, error)
// CreateTenantAppMenuIds 添加租户应用的菜单ids
CreateTenantAppMenuIds(ctx core.Context, tid, aid uint32, mids []uint32) error
// DeleteTenantAppMenuIds 获取租户应用的菜单ids
DeleteTenantAppMenuIds(ctx core.Context, tid, aid uint32, mids []uint32) error
}
type User ¶
type User interface {
// GetUser 获取指定的用户信息
GetUser(ctx core.Context, id uint32) (*entity.User, error)
// GetUserByUsername 获取指定的用户信息
GetUserByUsername(ctx core.Context, un string) (*entity.User, error)
// GetUserByTU 获取指定的用户信息
GetUserByTU(ctx core.Context, tid uint32, un string) (*entity.User, error)
// ListUser 获取用户信息列表
ListUser(ctx core.Context, req *types.ListUserRequest) ([]*entity.User, uint32, error)
// CreateUser 创建用户信息
CreateUser(ctx core.Context, req *entity.User) (uint32, error)
// UpdateUser 更新用户信息
UpdateUser(ctx core.Context, req *entity.User) error
// DeleteUser 删除用户信息
DeleteUser(ctx core.Context, id uint32) error
}
type UserDept ¶
type UserDept interface {
// GetDeptIdsByUserId 获取用户部门id
GetDeptIdsByUserId(userId uint32) []uint32
// GetUserMainDeptId 获取指定用户的主部门
GetUserMainDeptId(uid uint32) uint32
// ListDeptUser 获取角色的菜单列表
ListDeptUser(ctx core.Context, req *types.ListDeptUserRequest) ([]*entity.User, uint32, error)
// ListUserDept 获取指定菜单的角色列表
ListUserDept(ctx core.Context, req *types.ListUserDeptRequest) ([]*entity.UserDept, uint32, error)
// CreateUserDept 创建角色菜单的关联信息
CreateUserDept(ctx core.Context, ud *entity.UserDept) error
// UpdateUserDept 更新角色菜单的关联信息
UpdateUserDept(ctx core.Context, ud *entity.UserDept) error
// DeleteUserDept 删除角色菜单关联信息
DeleteUserDept(ctx core.Context, id uint32) error
}
type UserOAuther ¶ added in v1.2.8
type UserOAuther interface {
// CreateUserOAuther 创建用户授权信息
CreateUserOAuther(ctx core.Context, req *entity.UserOAuther) (uint32, error)
// DeleteUserOAuther 删除用户授权信息
DeleteUserOAuther(ctx core.Context, userId uint32, appId uint32) error
// IsBindUserOAuther 是否绑定授权信息
IsBindUserOAuther(ctx core.Context, channel uint32, oid string) bool
// GetUserOAutherByCO 获取指定的授权信息
GetUserOAutherByCO(ctx core.Context, cid uint32, oid string) (*entity.UserOAuther, error)
// UpdateUserOAuther 更新用户授权信息
UpdateUserOAuther(ctx core.Context, req *entity.UserOAuther) error
}
type UserSetting ¶
type UserSetting interface {
// GetUserSetting 获取用户信息列表
GetUserSetting(ctx core.Context, req *types.GetUserSettingRequest) (*entity.UserSetting, error)
// UpsertUserSetting 更新用户信息
UpsertUserSetting(ctx core.Context, req *entity.UserSetting) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.