service

package
v0.0.0-...-fa598d4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyncDept

func SyncDept(dataList []*Department, pid int, deptId int)

Recursive insert into db

Types

type DataPermService

type DataPermService struct {
}

DataPermService

func (DataPermService) Create

Create

func (DataPermService) Delete

func (DataPermService) Delete(dto dto.GeneralDelDto) int64

Delete

func (DataPermService) InfoOfId

get info by id

func (DataPermService) List

List

func (DataPermService) Update

Update

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 LoginLog

type LoginLog = model.LoginLog
type MenuPermAlias struct {
}

MenuPermAlias

type MenuService struct {
}
func (ms MenuService) Create(menuDto dto.MenuCreateDto) model.Menu

Create - create a menu item

func (ms MenuService) Delete(dto dto.GeneralDelDto) int64

Delete - delete menu

func (MenuService) InfoOfId(dto dto.GeneralGetDto) model.Menu

InfoOfId - get menu info by id

func (MenuService) List(treeDto dto.GeneralTreeDto) ([]model.Menu, int64)

List - users list with pagination

func (ms MenuService) Update(menuDto dto.MenuEditDto) int64

Update

type MyAccountService

type MyAccountService struct {
	// contains filtered or unexported fields
}

func (MyAccountService) BindDingtalk

func (s MyAccountService) BindDingtalk(code string, uid int, from int) (openid string, err error)

绑定第三方应用

func (MyAccountService) GetOpen

func (s MyAccountService) GetOpen(uid int) bool

*

is open user secret

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

func (SettingService) SyncDingtalk

func (s SettingService) SyncDingtalk() bool

sync dept

type UserSecretService

type UserSecretService struct {
}

DomainService

func (UserSecretService) Create

Create - create a new domain

func (UserSecretService) InfoOfId

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

func (UserService) VerifyAndReturnLdapUserInfo(dto dto.LoginDto) (bool, model.User)

Verfy Ldap userinfo

func (UserService) VerifyAndReturnUserInfo

func (UserService) VerifyAndReturnUserInfo(dto dto.LoginDto) (bool, model.User)

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

Jump to

Keyboard shortcuts

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