logic

package
v0.5.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReqAssertErr = tools.NewRspError(tools.SystemErr, fmt.Errorf("请求异常"))

	Api           = &ApiLogic{}
	User          = &UserLogic{}
	Group         = &GroupLogic{}
	Role          = &RoleLogic{}
	Menu          = &MenuLogic{}
	OperationLog  = &OperationLogLogic{}
	DingTalk      = &DingTalkLogic{}
	WeCom         = &WeComLogic{}
	FeiShu        = &FeiShuLogic{}
	OpenLdap      = &OpenLdapLogic{}
	Sql           = &SqlLogic{}
	Base          = &BaseLogic{}
	FieldRelation = &FieldRelationLogic{}
)

Functions

func BuildGroupData added in v0.5.0

func BuildGroupData(flag string, remoteData map[string]interface{}) (*model.Group, error)

BuildGroupData 根据数据与动态字段组装成分组数据

func BuildUserData added in v0.5.0

func BuildUserData(flag string, remoteData map[string]interface{}) (*model.User, error)

BuildUserData 根据数据与动态字段组装成用户数据

func CommonAddGroup added in v0.1.1

func CommonAddGroup(group *model.Group) error

CommonAddGroup 标准创建分组

func CommonAddUser added in v0.1.1

func CommonAddUser(user *model.User, groups []*model.Group) error

CommonAddUser 标准创建用户

func CommonUpdateGroup added in v0.1.1

func CommonUpdateGroup(oldGroup, newGroup *model.Group) error

CommonUpdateGroup 标准更新分组

func CommonUpdateUser added in v0.1.1

func CommonUpdateUser(oldUser, newUser *model.User, groupId []uint) error

CommonUpdateUser 标准更新用户

func ConvertDeptData added in v0.5.0

func ConvertDeptData(flag string, remoteData []map[string]interface{}) (groups []*model.Group, err error)

ConvertDeptData 将部门信息转成本地结构体

func ConvertUserData added in v0.5.0

func ConvertUserData(flag string, remoteData []map[string]interface{}) (users []*model.User, err error)

ConvertUserData 将用户信息转成本地结构体

func GroupListToTree added in v0.5.1

func GroupListToTree(rootId string, groupList []*model.Group) *model.Group

func InitCron added in v0.5.0

func InitCron()

func SearchGroupDiff added in v0.5.5

func SearchGroupDiff() (err error)

SearchGroupDiff 检索未同步到ldap中的分组

func SearchUserDiff added in v0.5.5

func SearchUserDiff() (err error)

SearchUserDiff 检索未同步到ldap中的用户

Types

type ApiLogic

type ApiLogic struct{}

func (ApiLogic) Add

func (l ApiLogic) Add(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Add 添加数据

func (ApiLogic) Delete

func (l ApiLogic) Delete(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Delete 删除数据

func (ApiLogic) GetTree

func (l ApiLogic) GetTree(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

GetTree 数据树

func (ApiLogic) List

func (l ApiLogic) List(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

List 数据列表

func (ApiLogic) Update

func (l ApiLogic) Update(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Update 更新数据

type BaseLogic

type BaseLogic struct{}

func (BaseLogic) ChangePwd

func (l BaseLogic) ChangePwd(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

ChangePwd 重置密码

func (BaseLogic) Dashboard

func (l BaseLogic) Dashboard(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Dashboard 仪表盘

func (BaseLogic) DecryptPasswd added in v0.5.5

func (l BaseLogic) DecryptPasswd(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

DecryptPasswd

func (BaseLogic) EncryptPasswd added in v0.5.5

func (l BaseLogic) EncryptPasswd(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

EncryptPasswd

func (BaseLogic) SendCode added in v0.5.8

func (l BaseLogic) SendCode(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

SendCode 发送验证码

type DingTalkLogic

type DingTalkLogic struct {
}

func (DingTalkLogic) AddDepts added in v0.1.1

func (d DingTalkLogic) AddDepts(group *model.Group) error

AddGroup 添加部门数据

func (DingTalkLogic) AddUsers added in v0.1.1

func (d DingTalkLogic) AddUsers(user *model.User) error

AddUser 添加用户数据

func (*DingTalkLogic) SyncDingTalkDepts added in v0.1.1

func (d *DingTalkLogic) SyncDingTalkDepts(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

通过钉钉获取部门信息

func (DingTalkLogic) SyncDingTalkUsers

func (d DingTalkLogic) SyncDingTalkUsers(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

根据现有数据库同步到的部门信息,开启用户同步

type FeiShuLogic added in v0.3.0

type FeiShuLogic struct {
}

func (FeiShuLogic) AddDepts added in v0.3.0

func (d FeiShuLogic) AddDepts(group *model.Group) error

AddGroup 添加部门数据

func (FeiShuLogic) AddUsers added in v0.3.0

func (d FeiShuLogic) AddUsers(user *model.User) error

AddUser 添加用户数据

func (*FeiShuLogic) SyncFeiShuDepts added in v0.3.0

func (d *FeiShuLogic) SyncFeiShuDepts(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

通过飞书获取部门信息

func (FeiShuLogic) SyncFeiShuUsers added in v0.3.0

func (d FeiShuLogic) SyncFeiShuUsers(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

根据现有数据库同步到的部门信息,开启用户同步

type FieldRelationLogic added in v0.5.0

type FieldRelationLogic struct{}

func (FieldRelationLogic) Add added in v0.5.0

func (l FieldRelationLogic) Add(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Add 添加数据

func (FieldRelationLogic) Delete added in v0.5.0

func (l FieldRelationLogic) Delete(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Delete 删除数据

func (FieldRelationLogic) List added in v0.5.0

func (l FieldRelationLogic) List(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

List 数据列表

func (FieldRelationLogic) Update added in v0.5.0

func (l FieldRelationLogic) Update(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Update 更新数据

type GroupLogic

type GroupLogic struct{}

func (GroupLogic) Add

func (l GroupLogic) Add(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Add 添加数据

func (GroupLogic) AddUser

func (l GroupLogic) AddUser(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

AddUser 添加用户到分组

func (GroupLogic) Delete

func (l GroupLogic) Delete(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Delete 删除数据

func (GroupLogic) GetTree

func (l GroupLogic) GetTree(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

GetTree 数据树

func (GroupLogic) List

func (l GroupLogic) List(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

List 数据列表

func (GroupLogic) RemoveUser

func (l GroupLogic) RemoveUser(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

RemoveUser 移除用户

func (GroupLogic) Update

func (l GroupLogic) Update(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Update 更新数据

func (GroupLogic) UserInGroup

func (l GroupLogic) UserInGroup(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

UserInGroup 在分组内的用户

func (GroupLogic) UserNoInGroup

func (l GroupLogic) UserNoInGroup(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

UserNoInGroup 不在分组内的用户

type MenuLogic struct{}
func (l MenuLogic) Add(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Add 添加数据

func (l MenuLogic) Delete(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Delete 删除数据

func (l MenuLogic) GetAccessTree(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

GetAccessTree 获取用户菜单树

func (l MenuLogic) GetTree(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

GetTree 数据树

func (l MenuLogic) Update(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Update 更新数据

type OpenLdapLogic added in v0.5.0

type OpenLdapLogic struct {
}

func (OpenLdapLogic) AddDepts added in v0.5.0

func (d OpenLdapLogic) AddDepts(group *model.Group) error

AddGroup 添加部门数据

func (OpenLdapLogic) AddUsers added in v0.5.0

func (d OpenLdapLogic) AddUsers(user *model.User) error

AddUser 添加用户数据

func (*OpenLdapLogic) SyncOpenLdapDepts added in v0.5.0

func (d *OpenLdapLogic) SyncOpenLdapDepts(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

通过ldap获取部门信息

func (OpenLdapLogic) SyncOpenLdapUsers added in v0.5.0

func (d OpenLdapLogic) SyncOpenLdapUsers(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

根据现有数据库同步到的部门信息,开启用户同步

type OperationLogLogic

type OperationLogLogic struct{}

func (OperationLogLogic) Clean added in v0.5.18

func (l OperationLogLogic) Clean(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

func (OperationLogLogic) Delete

func (l OperationLogLogic) Delete(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Delete 删除数据

func (OperationLogLogic) List

func (l OperationLogLogic) List(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

List 数据列表

type RoleLogic

type RoleLogic struct{}

func (RoleLogic) Add

func (l RoleLogic) Add(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Add 添加数据

func (RoleLogic) Delete

func (l RoleLogic) Delete(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Delete 删除数据

func (RoleLogic) GetApiList

func (l RoleLogic) GetApiList(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

GetApiList 获取角色接口列表

func (RoleLogic) GetMenuList

func (l RoleLogic) GetMenuList(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

GetMenuList 获取角色菜单列表

func (RoleLogic) List

func (l RoleLogic) List(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

List 数据列表

func (RoleLogic) Update

func (l RoleLogic) Update(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Update 更新数据

func (RoleLogic) UpdateApis

func (l RoleLogic) UpdateApis(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

UpdateApis 更新角色接口

func (RoleLogic) UpdateMenus

func (l RoleLogic) UpdateMenus(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

UpdateMenus 更新角色菜单

type SqlLogic added in v0.5.5

type SqlLogic struct{}

func (*SqlLogic) SyncSqlGroups added in v0.5.5

func (d *SqlLogic) SyncSqlGroups(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

SyncSqlGroups 同步sql中的分组信息到ldap

func (*SqlLogic) SyncSqlUsers added in v0.5.5

func (d *SqlLogic) SyncSqlUsers(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

SyncSqlUsers 同步sql的用户信息到ldap

type UserLogic

type UserLogic struct{}

func (UserLogic) Add

func (l UserLogic) Add(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Add 添加数据

func (UserLogic) ChangePwd

func (l UserLogic) ChangePwd(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

ChangePwd 修改密码

func (UserLogic) ChangeUserStatus

func (l UserLogic) ChangeUserStatus(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

ChangeUserStatus 修改用户状态

func (UserLogic) Delete

func (l UserLogic) Delete(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Delete 删除数据

func (UserLogic) GetUserInfo

func (l UserLogic) GetUserInfo(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

GetUserInfo 获取用户信息

func (UserLogic) List

func (l UserLogic) List(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

List 数据列表

func (UserLogic) Update

func (l UserLogic) Update(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

Update 更新数据

type WeComLogic added in v0.2.0

type WeComLogic struct {
}

func (WeComLogic) AddDepts added in v0.2.0

func (d WeComLogic) AddDepts(group *model.Group) error

AddGroup 添加部门数据

func (WeComLogic) AddUsers added in v0.2.0

func (d WeComLogic) AddUsers(user *model.User) error

AddUser 添加用户数据

func (*WeComLogic) SyncWeComDepts added in v0.2.0

func (d *WeComLogic) SyncWeComDepts(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

通过企业微信获取部门信息

func (WeComLogic) SyncWeComUsers added in v0.2.0

func (d WeComLogic) SyncWeComUsers(c *gin.Context, req interface{}) (data interface{}, rspError interface{})

根据现有数据库同步到的部门信息,开启用户同步

Jump to

Keyboard shortcuts

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