feishu

package
v1.19.28 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Api = feishuApi.New(global.Config.Feishu.ClientID, global.Config.Feishu.Secret, tools.Http.Client)

Functions

func InitSync

func InitSync(c *cron.Cron)

func NewDepartmentSyncBackOff

func NewDepartmentSyncBackOff(stat redis.SyncStat, schedule cron.Schedule) backoff.Backoff

func NewUserSyncBackoff

func NewUserSyncBackoff(stat redis.SyncStat, schedule cron.Schedule) backoff.Backoff

Types

type RelatedUserInfo

type RelatedUserInfo struct {
	Data        dao.User
	Departments []uint
}

type User

type User struct {
	ID   uint // 辅助字段,初始为空
	Data *feishuApi.User
}

func NewUser

func NewUser(data *feishuApi.User) *User

func (User) Departments

func (u User) Departments(groupMap map[string]uint) UserDepartment

func (User) IsInvalid

func (u User) IsInvalid() bool

func (User) IsModelEmpty

func (u User) IsModelEmpty() bool

func (User) Model

func (u User) Model() dao.User

Model 注意需要同时修改下方的 IsModelEmpty

type UserDepartment

type UserDepartment struct {
	GidList    []uint
	OpenIdList []string
}

func (UserDepartment) Ids

func (d UserDepartment) Ids() []uint

func (UserDepartment) Models

func (d UserDepartment) Models(uid uint) []dao.UserGroups

func (UserDepartment) Sync

func (d UserDepartment) Sync(tx *gorm.DB, uid uint) error

type UserSyncProcessor

type UserSyncProcessor struct {
	Cost time.Duration
	// contains filtered or unexported fields
}

func (*UserSyncProcessor) PrintSyncResult

func (a *UserSyncProcessor) PrintSyncResult()

func (*UserSyncProcessor) Run

func (a *UserSyncProcessor) Run() error

Jump to

Keyboard shortcuts

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