service

package
v1.17.60 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App = AppSrv{dao.DB}
View Source
var AppGroup = AppGroupSrv{dao.DB}
View Source
var BaseGroups = BaseGroupsSrv{dao.DB}
View Source
var FeishuGroups = FeishuGroupsSrv{dao.DB}
View Source
var LoginRecord = LoginRecordSrv{dao.DB}
View Source
var SiteWhiteList = SiteWhiteListSrv{dao.DB}
View Source
var User = UserSrv{dao.DB}
View Source
var UserGroups = UserGroupsSrv{dao.DB}
View Source
var UserSsh = UserSshSrv{dao.DB}
View Source
var WebAuthn = WebAuthnSrv{dao.DB}

Functions

This section is empty.

Types

type AppGroupSrv

type AppGroupSrv struct {
	*gorm.DB
}

func (AppGroupSrv) Begin

func (a AppGroupSrv) Begin() (AppGroupSrv, error)

func (AppGroupSrv) BindForApp

func (a AppGroupSrv) BindForApp(aid uint, groupIds []uint) ([]dto.Group, error)

func (AppGroupSrv) DeleteAllForApp

func (a AppGroupSrv) DeleteAllForApp(aid uint) error

func (AppGroupSrv) UnBindForApp

func (a AppGroupSrv) UnBindForApp(aid uint, groupIds []uint) error

type AppSrv

type AppSrv struct {
	*gorm.DB
}

func (AppSrv) AddAppCodeToRedis added in v1.17.16

func (a AppSrv) AddAppCodeToRedis(appCode ...string) error

func (AppSrv) AppCodeExist

func (a AppSrv) AppCodeExist(appCode string) (bool, error)

func (AppSrv) Begin

func (a AppSrv) Begin() (AppSrv, error)

func (AppSrv) CheckAppCode

func (a AppSrv) CheckAppCode(appCode string) (bool, error)

func (AppSrv) DeleteByID

func (a AppSrv) DeleteByID(id, uid uint) error

func (AppSrv) FirstAppByAppCode

func (a AppSrv) FirstAppByAppCode(appCode string) (*dao.App, error)

func (AppSrv) FirstAppByID

func (a AppSrv) FirstAppByID(id uint) (*dao.App, error)

func (AppSrv) FirstAppCallbackByID

func (a AppSrv) FirstAppCallbackByID(id uint) (string, error)

func (AppSrv) FirstAppCodeByID

func (a AppSrv) FirstAppCodeByID(id, uid uint, opts ...daoUtil.ServiceOpt) (string, error)

func (AppSrv) FirstAppDetailedByIDForUser

func (a AppSrv) FirstAppDetailedByIDForUser(id, uid uint, opts ...daoUtil.ServiceOpt) (*dto.AppShowDetail, error)

func (AppSrv) FirstAppKeyPairByAppCode added in v1.17.2

func (a AppSrv) FirstAppKeyPairByAppCode(appCode string) (string, string, error)

func (AppSrv) FirstAppKeyPairByID added in v1.17.2

func (a AppSrv) FirstAppKeyPairByID(id uint) (string, string, error)

func (AppSrv) GetForUpdateViews

func (a AppSrv) GetForUpdateViews(opts ...daoUtil.ServiceOpt) ([]dao.App, error)

func (AppSrv) GetPermitAll

func (a AppSrv) GetPermitAll() ([]dto.AppShow, error)

func (AppSrv) GetUserAccessible

func (a AppSrv) GetUserAccessible(uid uint, isCenterMember bool) ([]dto.AppGroupClassified, error)

func (AppSrv) GetUserOwnedApp

func (a AppSrv) GetUserOwnedApp(uid uint) ([]dto.AppShowDetail, error)

func (AppSrv) LoadAppCodeToRedis added in v1.17.16

func (a AppSrv) LoadAppCodeToRedis() error

func (AppSrv) NameExist added in v1.16.25

func (a AppSrv) NameExist(name string, opts ...daoUtil.ServiceOpt) (bool, error)

func (AppSrv) New

func (a AppSrv) New(uid uint, name, callback string, permitAll bool) (*dao.App, error)

func (AppSrv) This

func (a AppSrv) This(host string) *dao.App

func (AppSrv) UpdateAll

func (a AppSrv) UpdateAll(id uint, name, callback string, permitAllGroup bool) error

func (AppSrv) UpdateLinkOff

func (a AppSrv) UpdateLinkOff(uid, id uint, linkOff bool) error

func (AppSrv) UpdateViews

func (a AppSrv) UpdateViews(id, viewsID uint, views uint64) error

func (AppSrv) UserAccessible

func (a AppSrv) UserAccessible(id, uid uint) (bool, error)

type BaseGroupsSrv

type BaseGroupsSrv struct {
	*gorm.DB
}

func (BaseGroupsSrv) Begin

func (a BaseGroupsSrv) Begin() (BaseGroupsSrv, error)

func (BaseGroupsSrv) CreateGroups

func (a BaseGroupsSrv) CreateGroups(groups []dao.BaseGroup) error

func (BaseGroupsSrv) LoadGroups

func (a BaseGroupsSrv) LoadGroups() ([]dao.BaseGroup, error)

func (BaseGroupsSrv) LoadGroupsForShow

func (a BaseGroupsSrv) LoadGroupsForShow() ([]dto.Group, error)

func (BaseGroupsSrv) LoadGroupsRelation

func (a BaseGroupsSrv) LoadGroupsRelation() (map[string]dao.BaseGroup, error)

type FeishuGroupsSrv

type FeishuGroupsSrv struct {
	*gorm.DB
}

func (FeishuGroupsSrv) Begin

func (a FeishuGroupsSrv) Begin() (FeishuGroupsSrv, error)

func (FeishuGroupsSrv) CreateAll

func (a FeishuGroupsSrv) CreateAll(data []dao.FeishuGroups) error

func (FeishuGroupsSrv) DeleteSelected

func (a FeishuGroupsSrv) DeleteSelected(ids []uint) error

func (FeishuGroupsSrv) GetAll

func (a FeishuGroupsSrv) GetAll(opts ...daoUtil.ServiceOpt) ([]dao.FeishuGroups, error)

func (FeishuGroupsSrv) GetByOpenID

func (a FeishuGroupsSrv) GetByOpenID(openID []string, opts ...daoUtil.ServiceOpt) ([]dao.FeishuGroups, error)

func (FeishuGroupsSrv) GetGroupMap

func (a FeishuGroupsSrv) GetGroupMap(opts ...daoUtil.ServiceOpt) (map[string]uint, error)

func (FeishuGroupsSrv) Search

func (a FeishuGroupsSrv) Search(openID []string) ([]dao.BaseGroup, error)

type LoginRecordSrv

type LoginRecordSrv struct {
	*gorm.DB
}

func (LoginRecordSrv) Add

func (a LoginRecordSrv) Add(uid, appID uint, ip, useragent string, tokenValid time.Duration) (uint, error)

func (LoginRecordSrv) Begin

func (a LoginRecordSrv) Begin() (*LoginRecordSrv, error)

func (LoginRecordSrv) GetMultipleViewsIDs

func (a LoginRecordSrv) GetMultipleViewsIDs(apps []dao.App) ([]dto.ViewID, error)

func (LoginRecordSrv) GetValidForApp added in v1.17.39

func (a LoginRecordSrv) GetValidForApp(aid uint, opt ...daoUtil.ServiceOpt) ([]uint, error)

func (LoginRecordSrv) GetViewIDs

func (a LoginRecordSrv) GetViewIDs(aid, startAt uint) ([]uint, error)

func (LoginRecordSrv) OnlineRecordExist added in v1.17.36

func (a LoginRecordSrv) OnlineRecordExist(uid, id uint, opts ...daoUtil.ServiceOpt) (bool, error)

func (LoginRecordSrv) SetDestroyed added in v1.17.36

func (a LoginRecordSrv) SetDestroyed(id uint) error

func (LoginRecordSrv) SetDestroyedByIDS added in v1.17.39

func (a LoginRecordSrv) SetDestroyedByIDS(ids []uint) error

func (LoginRecordSrv) UserHistory

func (a LoginRecordSrv) UserHistory(uid uint, limit int) ([]dto.LoginRecord, error)

func (LoginRecordSrv) UserOnline added in v1.17.36

func (a LoginRecordSrv) UserOnline(uid uint, currentLoginID uint) ([]dto.LoginRecordOnline, error)

type SiteWhiteListSrv

type SiteWhiteListSrv struct {
	*gorm.DB
}

func (SiteWhiteListSrv) Begin

func (a SiteWhiteListSrv) Begin() (*SiteWhiteListSrv, error)

func (SiteWhiteListSrv) CheckUrl

func (a SiteWhiteListSrv) CheckUrl(link string) (bool, error)

func (SiteWhiteListSrv) Exist

func (a SiteWhiteListSrv) Exist(domain string) (bool, error)

type UserGroupsSrv

type UserGroupsSrv struct {
	*gorm.DB
}

func (UserGroupsSrv) Begin

func (a UserGroupsSrv) Begin() (UserGroupsSrv, error)

func (UserGroupsSrv) CreateAll

func (a UserGroupsSrv) CreateAll(data []dao.UserGroups) error

func (UserGroupsSrv) DeleteByIDSlice

func (a UserGroupsSrv) DeleteByIDSlice(id []uint) error

func (UserGroupsSrv) DeleteNotInGidSliceByUID

func (a UserGroupsSrv) DeleteNotInGidSliceByUID(uid uint, id []uint) *gorm.DB

func (UserGroupsSrv) GetAll

func (a UserGroupsSrv) GetAll() ([]dao.UserGroups, error)

func (UserGroupsSrv) GetForAppCode

func (a UserGroupsSrv) GetForAppCode(uid uint, appCode string) ([]string, error)

func (UserGroupsSrv) GetIdsForUser

func (a UserGroupsSrv) GetIdsForUser(uid uint) ([]uint, error)

func (UserGroupsSrv) GetNamesForUser

func (a UserGroupsSrv) GetNamesForUser(uid uint) ([]string, error)

func (UserGroupsSrv) IsUnitMember added in v1.16.14

func (a UserGroupsSrv) IsUnitMember(uid uint, Unit string) (bool, error)

IsUnitMember 是否是指定组组员

type UserSrv

type UserSrv struct {
	*gorm.DB
}

func (UserSrv) Begin

func (a UserSrv) Begin() (UserSrv, error)

func (UserSrv) CreateAll

func (a UserSrv) CreateAll(users []dao.User) error

func (UserSrv) DelMfa

func (a UserSrv) DelMfa(id uint) error

func (UserSrv) FirstByPhone

func (a UserSrv) FirstByPhone(phone string, opts ...daoUtil.ServiceOpt) (*dao.User, error)

func (UserSrv) FirstMfa

func (a UserSrv) FirstMfa(id uint, opts ...daoUtil.ServiceOpt) (string, error)

func (UserSrv) FirstPhoneByID

func (a UserSrv) FirstPhoneByID(id uint) (string, error)

func (UserSrv) FrozeByIDSlice

func (a UserSrv) FrozeByIDSlice(id []uint) error

func (UserSrv) FrozeByPhone

func (a UserSrv) FrozeByPhone(phone string) *gorm.DB

func (UserSrv) GetUnscopedUserByPhoneSlice

func (a UserSrv) GetUnscopedUserByPhoneSlice(phone []string) ([]dao.User, error)

func (UserSrv) GetUserNotInPhoneSlice

func (a UserSrv) GetUserNotInPhoneSlice(phone []string) ([]dao.User, error)

func (UserSrv) MfaExist

func (a UserSrv) MfaExist(id uint, opts ...daoUtil.ServiceOpt) (bool, error)

func (UserSrv) SetMfaSecret

func (a UserSrv) SetMfaSecret(id uint, secret string) error

func (UserSrv) U2fStatus

func (a UserSrv) U2fStatus(id uint) (*dto.UserU2fStatus, error)

func (UserSrv) UnFrozeByIDSlice

func (a UserSrv) UnFrozeByIDSlice(id []uint) error

func (UserSrv) UpdateUserPreferU2F

func (a UserSrv) UpdateUserPreferU2F(id uint, prefer string) error

func (UserSrv) UserIdExist added in v1.17.7

func (a UserSrv) UserIdExist(uid uint, opts ...daoUtil.ServiceOpt) (bool, error)

func (UserSrv) UserInfoByID

func (a UserSrv) UserInfoByID(id uint) (*dao.User, error)

func (UserSrv) UserProfile

func (a UserSrv) UserProfile(id uint) (*dto.UserProfile, error)

type UserSshSrv

type UserSshSrv struct {
	*gorm.DB
}

func (UserSshSrv) Begin

func (a UserSshSrv) Begin() (UserSshSrv, error)

func (UserSshSrv) CreateAll

func (a UserSshSrv) CreateAll(data []dao.UserSsh) error

func (UserSshSrv) DeleteInvalid

func (a UserSshSrv) DeleteInvalid() ([]dao.UserSsh, error)

func (UserSshSrv) Exist

func (a UserSshSrv) Exist(uid uint, opt ...daoUtil.ServiceOpt) (bool, error)

func (UserSshSrv) FirstSshSecretsForUserShow

func (a UserSshSrv) FirstSshSecretsForUserShow(uid uint) (*dto.SshSecrets, error)

func (UserSshSrv) GetAllExist

func (a UserSshSrv) GetAllExist() ([]dto.SshDeploy, error)

func (UserSshSrv) GetToCreateUid

func (a UserSshSrv) GetToCreateUid() ([]uint, error)

GetToCreateUid 获取没有生成 ssh 账号的 uid

func (UserSshSrv) UpdateKeys

func (a UserSshSrv) UpdateKeys(uid uint, publicPem, privatePem, publicSsh, privateSsh string) error

type WebAuthnSrv

type WebAuthnSrv struct {
	*gorm.DB
}

func (WebAuthnSrv) Add

func (a WebAuthnSrv) Add(uid uint, cred *webauthn.Credential) (*dto.UserCredential, error)

func (WebAuthnSrv) Begin

func (a WebAuthnSrv) Begin() (WebAuthnSrv, error)

func (WebAuthnSrv) Delete

func (a WebAuthnSrv) Delete(id, uid uint) error

func (WebAuthnSrv) Exist

func (a WebAuthnSrv) Exist(id, uid uint, opt ...daoUtil.ServiceOpt) (bool, error)

func (WebAuthnSrv) GetCredentials

func (a WebAuthnSrv) GetCredentials(uid uint) ([]webauthn.Credential, error)

func (WebAuthnSrv) ListUserCredForShow

func (a WebAuthnSrv) ListUserCredForShow(uid uint) ([]dto.UserCredential, error)

func (WebAuthnSrv) Rename

func (a WebAuthnSrv) Rename(id uint, name string) error

func (WebAuthnSrv) UpdateLastUsedAt

func (a WebAuthnSrv) UpdateLastUsedAt(uid uint, rawId string) error

func (WebAuthnSrv) UserName

func (a WebAuthnSrv) UserName(id uint) (string, error)

Jump to

Keyboard shortcuts

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