Documentation ¶
Index ¶
- func SyncDept(dataList []*Department, pid int, deptId int)
- type DataPermService
- func (DataPermService) Create(dto dto.DataPermAddDto) model.DataPerm
- func (DataPermService) Delete(dto dto.GeneralDelDto) int64
- func (DataPermService) InfoOfId(dto dto.GeneralGetDto) model.DataPerm
- func (DataPermService) List(dto dto.GeneralListDto) ([]model.DataPerm, int64)
- func (DataPermService) Update(dto dto.DataPermEditDto) int64
- type Department
- type DeptService
- func (us DeptService) CheckIfPeopleInside(dto dto.GeneralDelDto) int64
- func (us DeptService) Create(dto dto.DeptCreateDto) model.Department
- func (us DeptService) Delete(dto dto.GeneralDelDto) int64
- func (us DeptService) InfoOfId(dto dto.GeneralGetDto) model.Department
- func (us DeptService) List(dto dto.GeneralListDto) ([]model.Department, int64)
- func (us DeptService) Update(dto dto.DeptEditDto) int64
- type DingTalkService
- type DomainService
- func (us DomainService) Create(dto dto.DomainCreateDto) model.Domain
- func (us DomainService) Delete(dto dto.GeneralDelDto) int64
- func (us DomainService) InfoOfId(dto dto.GeneralGetDto) model.Domain
- func (us DomainService) List(dto dto.GeneralListDto) ([]model.Domain, int64)
- func (us DomainService) Update(dto dto.DomainEditDto) int64
- type InstallService
- type LogService
- func (LogService) InsertOperationLog(orLogDto *dto.OperationLogDto) error
- func (LogService) LoginLogDetail(dto dto.GeneralGetDto) LoginLog
- func (LogService) LoginLogLists(dto dto.LoginLogListDto) ([]dao.LoginLogList, int64)
- func (LogService) OperationLogDetail(dto dto.GeneralGetDto) OperationLog
- func (LogService) OperationLogLists(dto dto.OperationLogListDto) ([]dao.OperationLogList, int64)
- type LoginLog
- type MenuPermAlias
- type MenuService
- func (ms MenuService) Create(menuDto dto.MenuCreateDto) model.Menu
- func (ms MenuService) Delete(dto dto.GeneralDelDto) int64
- func (MenuService) InfoOfId(dto dto.GeneralGetDto) model.Menu
- func (MenuService) List(treeDto dto.GeneralTreeDto) ([]model.Menu, int64)
- func (ms MenuService) Update(menuDto dto.MenuEditDto) int64
- type MyAccountService
- func (s MyAccountService) BindDingtalk(code string, uid int, from int) (openid string, err error)
- func (s MyAccountService) GetOpen(uid int) bool
- func (s MyAccountService) GetSecret(uid int) (userSecretQuery model.UserSecretQuery, err error)
- func (s MyAccountService) GetThirdList(dto dto.GeneralListDto) ([]model.UserOAuth, int64)
- func (s MyAccountService) Update2FaStatus(uid int, is_open int) int64
- func (s MyAccountService) UploadAvatar(file multipart.File, filename string, uid int) (filepath string, err error)
- type OperationLog
- type RoleService
- func (rs RoleService) AssignDataPerm(roleId int, dataPermIds string) error
- func (RoleService) AssignPermission(roleId int, menuIds string)
- func (rs RoleService) Create(dto dto.RoleCreateDto) (model.Role, error)
- func (rl RoleService) Delete(dto dto.GeneralDelDto) int64
- func (rl RoleService) GetRoleDataPermsByRoleId(roleId int) ([]model.GetByRoleIdData, int64)
- func (RoleService) InfoOfId(dto dto.GeneralGetDto) model.Role
- func (RoleService) List(dto dto.GeneralListDto) ([]model.Role, int64)
- func (rs RoleService) Update(roleDto dto.RoleEditDto) int64
- type SettingService
- type UserSecretService
- type UserService
- func (UserService) AssignRole(userId string, roleNames []string)
- func (UserService) AssignRoleByRoleIds(userId string, roles string)
- func (us UserService) CheckPermission(uid string, domain string, policy string) bool
- func (us UserService) Create(userDto dto.UserCreateDto) (*model.User, error)
- func (us UserService) Delete(dto dto.GeneralDelDto) int64
- func (UserService) GetAllPermissions(uid string) []string
- func (UserService) GetAllRoles(uid string) []string
- func (us UserService) GetBindOauthUserInfo(uid int) (UserInfo model.UserOAuth)
- func (us UserService) GetDomainMenu(uid string, domain string) []model.Menu
- func (UserService) GetMenusOfDomain(uid string, domain string) []model.Role
- func (UserService) GetPermissionsOfDomain(uid string, domain string) []string
- func (UserService) GetRelatedDomains(uid string) []model.Domain
- func (us UserService) InfoOfId(dto dto.GeneralGetDto) model.User
- func (us UserService) InsertLoginLog(loginLogDto *dto.LoginLogDto) error
- func (us UserService) List(dto dto.GeneralListDto) ([]model.User, int64)
- func (UserService) MoveToAnotherDepartment(uids []string, target int) error
- func (us UserService) UnBindUserDingtalk(from int, uid int) error
- func (us UserService) Update(userDto dto.UserEditDto) int64
- func (UserService) UpdatePassword(dto dto.UserEditPasswordDto) int64
- func (UserService) UpdateStatus(dto dto.UserEditStatusDto) int64
- func (UserService) VerifyAndReturnLdapUserInfo(dto dto.LoginDto) (bool, model.User)
- func (UserService) VerifyAndReturnUserInfo(dto dto.LoginDto) (bool, model.User)
- func (us UserService) VerifyDTAndReturnUserInfo(code string) (user model.UserOAuth, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataPermService ¶
type DataPermService struct { }
DataPermService
func (DataPermService) Create ¶
func (DataPermService) Create(dto dto.DataPermAddDto) model.DataPerm
Create
func (DataPermService) InfoOfId ¶
func (DataPermService) InfoOfId(dto dto.GeneralGetDto) model.DataPerm
get info by id
func (DataPermService) List ¶
func (DataPermService) List(dto dto.GeneralListDto) ([]model.DataPerm, int64)
List
type Department ¶
type Department struct { Id int Name string ParentId int Children []*Department }
func NodeDataMerge ¶
func NodeDataMerge(nodeList []dingtalk.Department, pid int) (dataList []*Department, err error)
Recursive node for dept
type DeptService ¶
type DeptService struct { }
DeptService
func (DeptService) CheckIfPeopleInside ¶
func (us DeptService) CheckIfPeopleInside(dto dto.GeneralDelDto) int64
check - check has member TODO
func (DeptService) Create ¶
func (us DeptService) Create(dto dto.DeptCreateDto) model.Department
Create - create a new dept
func (DeptService) Delete ¶
func (us DeptService) Delete(dto dto.GeneralDelDto) int64
Delete - delete dept
func (DeptService) InfoOfId ¶
func (us DeptService) InfoOfId(dto dto.GeneralGetDto) model.Department
InfoOfId - get dept info by id
func (DeptService) List ¶
func (us DeptService) List(dto dto.GeneralListDto) ([]model.Department, int64)
List - users list with pagination
func (DeptService) Update ¶
func (us DeptService) Update(dto dto.DeptEditDto) int64
Update - update dept's information
type DingTalkService ¶
type DingTalkService struct{}
func (DingTalkService) SyncRecursive ¶
func (ds DingTalkService) SyncRecursive(departments map[int][]dingtalk.Department, id int, pid int)
func (DingTalkService) SyncUsersAndDepartments ¶
func (ds DingTalkService) SyncUsersAndDepartments()
type DomainService ¶
type DomainService struct { }
DomainService
func (DomainService) Create ¶
func (us DomainService) Create(dto dto.DomainCreateDto) model.Domain
Create - create a new domain
func (DomainService) Delete ¶
func (us DomainService) Delete(dto dto.GeneralDelDto) int64
Delete - delete domain
func (DomainService) InfoOfId ¶
func (us DomainService) InfoOfId(dto dto.GeneralGetDto) model.Domain
InfoOfId - get role info by id
func (DomainService) List ¶
func (us DomainService) List(dto dto.GeneralListDto) ([]model.Domain, int64)
List - users list with pagination
func (DomainService) Update ¶
func (us DomainService) Update(dto dto.DomainEditDto) int64
Update - update domain's information
type InstallService ¶
type InstallService struct { }
func (InstallService) Install ¶
func (us InstallService) Install(dto dto.InstallDTO) bool
func (InstallService) Islock ¶
func (us InstallService) Islock() bool
type LogService ¶
type LogService struct { }
func (LogService) InsertOperationLog ¶
func (LogService) InsertOperationLog(orLogDto *dto.OperationLogDto) error
Insert Operation Log
func (LogService) LoginLogDetail ¶
func (LogService) LoginLogDetail(dto dto.GeneralGetDto) LoginLog
func (LogService) LoginLogLists ¶
func (LogService) LoginLogLists(dto dto.LoginLogListDto) ([]dao.LoginLogList, int64)
List - users list with pagination
func (LogService) OperationLogDetail ¶
func (LogService) OperationLogDetail(dto dto.GeneralGetDto) OperationLog
func (LogService) OperationLogLists ¶
func (LogService) OperationLogLists(dto dto.OperationLogListDto) ([]dao.OperationLogList, int64)
List - users list with pagination
type MenuService ¶
type MenuService struct { }
func (MenuService) Create ¶
func (ms MenuService) Create(menuDto dto.MenuCreateDto) model.Menu
Create - create a menu item
func (MenuService) Delete ¶
func (ms MenuService) Delete(dto dto.GeneralDelDto) int64
Delete - delete menu
func (MenuService) InfoOfId ¶
func (MenuService) InfoOfId(dto dto.GeneralGetDto) model.Menu
InfoOfId - get menu info by id
func (MenuService) List ¶
func (MenuService) List(treeDto dto.GeneralTreeDto) ([]model.Menu, int64)
List - users list with pagination
type MyAccountService ¶
type MyAccountService struct {
// contains filtered or unexported fields
}
func (MyAccountService) BindDingtalk ¶
绑定第三方应用
func (MyAccountService) GetOpen ¶
func (s MyAccountService) GetOpen(uid int) bool
*
is open user secret
func (MyAccountService) GetSecret ¶
func (s MyAccountService) GetSecret(uid int) (userSecretQuery model.UserSecretQuery, err error)
https://github.com/google/google-authenticator/wiki/Key-Uri-Format
func (MyAccountService) GetThirdList ¶
func (s MyAccountService) GetThirdList(dto dto.GeneralListDto) ([]model.UserOAuth, int64)
* 获取第三方账号绑定列表
func (MyAccountService) Update2FaStatus ¶
func (s MyAccountService) Update2FaStatus(uid int, is_open int) int64
func (MyAccountService) UploadAvatar ¶
func (s MyAccountService) UploadAvatar(file multipart.File, filename string, uid int) (filepath string, err error)
上传头像
type OperationLog ¶
type OperationLog = model.OperationLog
type RoleService ¶
type RoleService struct { }
RoleService
func (RoleService) AssignDataPerm ¶
func (rs RoleService) AssignDataPerm(roleId int, dataPermIds string) error
assign data permission
func (RoleService) AssignPermission ¶
func (RoleService) AssignPermission(roleId int, menuIds string)
AssignPermission - assign permissions
func (RoleService) Create ¶
func (rs RoleService) Create(dto dto.RoleCreateDto) (model.Role, error)
Create - create a new role
func (RoleService) Delete ¶
func (rl RoleService) Delete(dto dto.GeneralDelDto) int64
Delete - delete role
func (RoleService) GetRoleDataPermsByRoleId ¶
func (rl RoleService) GetRoleDataPermsByRoleId(roleId int) ([]model.GetByRoleIdData, int64)
通过角色id获取数据权限列表
func (RoleService) InfoOfId ¶
func (RoleService) InfoOfId(dto dto.GeneralGetDto) model.Role
InfoOfId - get role info by id
func (RoleService) List ¶
func (RoleService) List(dto dto.GeneralListDto) ([]model.Role, int64)
List - users list with pagination
func (RoleService) Update ¶
func (rs RoleService) Update(roleDto dto.RoleEditDto) int64
Update - update role's information
type SettingService ¶
type SettingService struct { }
func (SettingService) EmailUpdate ¶
func (s SettingService) EmailUpdate(SettingDTO dto.EmailSettingDTO) bool
func (SettingService) GetEmail ¶
func (s SettingService) GetEmail() model.EmailSetting
func (SettingService) GetLdap ¶
func (s SettingService) GetLdap() model.LdapSetting
func (SettingService) LdapUpdate ¶
func (s SettingService) LdapUpdate(SettingDTO dto.SettingDTO) bool
type UserSecretService ¶
type UserSecretService struct { }
DomainService
func (UserSecretService) Create ¶
func (us UserSecretService) Create(dto dto.UserSecretCreateDto) model.UserSecret
Create - create a new domain
func (UserSecretService) InfoOfId ¶
func (us UserSecretService) InfoOfId(dto dto.GeneralGetDto) model.UserSecret
InfoOfId - get role info by id
type UserService ¶
type UserService struct { }
func (UserService) AssignRole ¶
func (UserService) AssignRole(userId string, roleNames []string)
AssignRole - assign roles to specific user 这个方法同时作用与用户角色,用户用户组
func (UserService) AssignRoleByRoleIds ¶
func (UserService) AssignRoleByRoleIds(userId string, roles string)
AssignRoleByRoleIds - assign roles to specific user
func (UserService) CheckPermission ¶
func (us UserService) CheckPermission(uid string, domain string, policy string) bool
CheckPermission - check user's permission in specific domain with specific policy
func (UserService) Create ¶
func (us UserService) Create(userDto dto.UserCreateDto) (*model.User, error)
Create - create a new account
func (UserService) Delete ¶
func (us UserService) Delete(dto dto.GeneralDelDto) int64
Delete - delete user
func (UserService) GetAllPermissions ¶
func (UserService) GetAllPermissions(uid string) []string
GetAllPermissions - get all permission by specific user
func (UserService) GetAllRoles ¶
func (UserService) GetAllRoles(uid string) []string
GetAllRoles would return all roles of a user
func (UserService) GetBindOauthUserInfo ¶
func (us UserService) GetBindOauthUserInfo(uid int) (UserInfo model.UserOAuth)
func (UserService) GetDomainMenu ¶
func (us UserService) GetDomainMenu(uid string, domain string) []model.Menu
GetDomainMenu - get specific user's menus of specific domain
func (UserService) GetMenusOfDomain ¶
func (UserService) GetMenusOfDomain(uid string, domain string) []model.Role
GetMenusOfDomain - get menus in specific domain
func (UserService) GetPermissionsOfDomain ¶
func (UserService) GetPermissionsOfDomain(uid string, domain string) []string
GetPermissionsOfDomain - Get pure permission list in specific domain(another backend system)
func (UserService) GetRelatedDomains ¶
func (UserService) GetRelatedDomains(uid string) []model.Domain
GetRelatedDomains - get related domains
func (UserService) InfoOfId ¶
func (us UserService) InfoOfId(dto dto.GeneralGetDto) model.User
func (UserService) InsertLoginLog ¶
func (us UserService) InsertLoginLog(loginLogDto *dto.LoginLogDto) error
insert login log
func (UserService) List ¶
func (us UserService) List(dto dto.GeneralListDto) ([]model.User, int64)
List - users list with pagination
func (UserService) MoveToAnotherDepartment ¶
func (UserService) MoveToAnotherDepartment(uids []string, target int) error
MoveToAnotherDepartment - move users to another department
func (UserService) UnBindUserDingtalk ¶
func (us UserService) UnBindUserDingtalk(from int, uid int) error
func (UserService) Update ¶
func (us UserService) Update(userDto dto.UserEditDto) int64
Update - update user's information
func (UserService) UpdatePassword ¶
func (UserService) UpdatePassword(dto dto.UserEditPasswordDto) int64
UpdatePassword - update password only
func (UserService) UpdateStatus ¶
func (UserService) UpdateStatus(dto dto.UserEditStatusDto) int64
UpdateStatus - update user's status only
func (UserService) VerifyAndReturnLdapUserInfo ¶
Verfy Ldap userinfo
func (UserService) VerifyAndReturnUserInfo ¶
VerifyAndReturnUserInfo - login and return user info
func (UserService) VerifyDTAndReturnUserInfo ¶
func (us UserService) VerifyDTAndReturnUserInfo(code string) (user model.UserOAuth, err error)
VerifyDTAndReturnUserInfo - verify dingtalk and return user info