Documentation
¶
Index ¶
- Variables
- type AuthUserInfoResp
- type Company
- func (c *Company) AuthUser(code string) (info *UserInfo, err error)
- func (c *Company) GetRedirectURL(callbackURl string) (redirectURL string)
- func (c *Company) GetUserDetailInfo(userid string) (info *UserDetailInfo, err error)
- func (c *Company) ListDepartmentAll() (err error)
- func (c *Company) ListUser() (err error)
- type Department
- type Employee
- type RespBody
- type UserCenter
- func (uc *UserCenter) AfterLogin(externalID, accessToken string)
- func (uc *UserCenter) CheckUserLogin(ctx *gin.Context)
- func (uc *UserCenter) ConfigFields() []plugin.ConfigField
- func (uc *UserCenter) ConfigReceiver(config []byte) error
- func (uc *UserCenter) ControlCenterItems() []plugin.ControlCenter
- func (uc *UserCenter) CronSyncData()
- func (uc *UserCenter) Data(ctx *gin.Context)
- func (uc *UserCenter) Description() plugin.UserCenterDesc
- func (uc *UserCenter) GetNewQuestionSubscribers() (userIDs []string)
- func (uc *UserCenter) GetRedirectURL(ctx *gin.Context)
- func (uc *UserCenter) Info() plugin.Info
- func (uc *UserCenter) LoginCallback(ctx *plugin.GinContext) (userInfo *plugin.UserCenterBasicUserInfo, err error)
- func (uc *UserCenter) Notify(msg plugin.NotificationMessage)
- func (uc *UserCenter) PersonalBranding(externalID string) (branding []*plugin.PersonalBranding)
- func (uc *UserCenter) RegisterAuthAdminRouter(r *gin.RouterGroup)
- func (uc *UserCenter) RegisterAuthUserRouter(r *gin.RouterGroup)
- func (uc *UserCenter) RegisterUnAuthRouter(r *gin.RouterGroup)
- func (uc *UserCenter) SignUpCallback(ctx *plugin.GinContext) (userInfo *plugin.UserCenterBasicUserInfo, err error)
- func (uc *UserCenter) Sync(ctx *gin.Context)
- func (uc *UserCenter) UserConfigFields() []plugin.ConfigField
- func (uc *UserCenter) UserConfigReceiver(userID string, config []byte) error
- func (uc *UserCenter) UserInfo(externalID string) (userInfo *plugin.UserCenterBasicUserInfo, err error)
- func (uc *UserCenter) UserList(externalIDs []string) (userList []*plugin.UserCenterBasicUserInfo, err error)
- func (uc *UserCenter) UserSettings(externalID string) (userSettings *plugin.SettingInfo, err error)
- func (uc *UserCenter) UserStatus(externalID string) (userStatus plugin.UserStatus)
- type UserCenterConfig
- type UserConfig
- type UserConfigCache
- type UserDetailInfo
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var Info embed.FS
Functions ¶
This section is empty.
Types ¶
type AuthUserInfoResp ¶
type AuthUserInfoResp struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
Userid string `json:"userid"`
Mobile string `json:"mobile"`
Gender string `json:"gender"`
Email string `json:"email"`
Avatar string `json:"avatar"`
QrCode string `json:"qr_code"`
Address string `json:"address"`
}
type Company ¶
type Company struct {
CorpID string
CorpSecret string
AgentID string
CallbackURL string
Work *work.Work
DepartmentMapping map[int]*Department
EmployeeMapping map[string]*Employee
UserDetailInfoMapping map[string]*UserDetailInfo
}
func NewCompany ¶
func (*Company) GetRedirectURL ¶
func (*Company) GetUserDetailInfo ¶
func (c *Company) GetUserDetailInfo(userid string) (info *UserDetailInfo, err error)
func (*Company) ListDepartmentAll ¶
type Department ¶
type RespBody ¶
type RespBody struct {
// http code
Code int `json:"code"`
// reason key
Reason string `json:"reason"`
// response message
Message string `json:"msg"`
// response data
Data interface{} `json:"data"`
}
RespBody response body.
func NewRespBodyData ¶
NewRespBodyData new response body with data
type UserCenter ¶
type UserCenter struct {
Config *UserCenterConfig
Company *Company
UserConfigCache *UserConfigCache
Cache *cache.Cache
// contains filtered or unexported fields
}
func (*UserCenter) AfterLogin ¶
func (uc *UserCenter) AfterLogin(externalID, accessToken string)
func (*UserCenter) CheckUserLogin ¶
func (uc *UserCenter) CheckUserLogin(ctx *gin.Context)
func (*UserCenter) ConfigFields ¶
func (uc *UserCenter) ConfigFields() []plugin.ConfigField
func (*UserCenter) ConfigReceiver ¶
func (uc *UserCenter) ConfigReceiver(config []byte) error
func (*UserCenter) ControlCenterItems ¶
func (uc *UserCenter) ControlCenterItems() []plugin.ControlCenter
func (*UserCenter) CronSyncData ¶
func (uc *UserCenter) CronSyncData()
func (*UserCenter) Data ¶
func (uc *UserCenter) Data(ctx *gin.Context)
func (*UserCenter) Description ¶
func (uc *UserCenter) Description() plugin.UserCenterDesc
func (*UserCenter) GetNewQuestionSubscribers ¶
func (uc *UserCenter) GetNewQuestionSubscribers() (userIDs []string)
GetNewQuestionSubscribers returns the subscribers of the new question notification
func (*UserCenter) GetRedirectURL ¶
func (uc *UserCenter) GetRedirectURL(ctx *gin.Context)
func (*UserCenter) Info ¶
func (uc *UserCenter) Info() plugin.Info
func (*UserCenter) LoginCallback ¶
func (uc *UserCenter) LoginCallback(ctx *plugin.GinContext) (userInfo *plugin.UserCenterBasicUserInfo, err error)
func (*UserCenter) Notify ¶
func (uc *UserCenter) Notify(msg plugin.NotificationMessage)
Notify sends a notification to the user
func (*UserCenter) PersonalBranding ¶
func (uc *UserCenter) PersonalBranding(externalID string) (branding []*plugin.PersonalBranding)
func (*UserCenter) RegisterAuthAdminRouter ¶
func (uc *UserCenter) RegisterAuthAdminRouter(r *gin.RouterGroup)
func (*UserCenter) RegisterAuthUserRouter ¶
func (uc *UserCenter) RegisterAuthUserRouter(r *gin.RouterGroup)
func (*UserCenter) RegisterUnAuthRouter ¶
func (uc *UserCenter) RegisterUnAuthRouter(r *gin.RouterGroup)
func (*UserCenter) SignUpCallback ¶
func (uc *UserCenter) SignUpCallback(ctx *plugin.GinContext) (userInfo *plugin.UserCenterBasicUserInfo, err error)
func (*UserCenter) Sync ¶
func (uc *UserCenter) Sync(ctx *gin.Context)
func (*UserCenter) UserConfigFields ¶
func (uc *UserCenter) UserConfigFields() []plugin.ConfigField
func (*UserCenter) UserConfigReceiver ¶
func (uc *UserCenter) UserConfigReceiver(userID string, config []byte) error
func (*UserCenter) UserInfo ¶
func (uc *UserCenter) UserInfo(externalID string) (userInfo *plugin.UserCenterBasicUserInfo, err error)
func (*UserCenter) UserList ¶
func (uc *UserCenter) UserList(externalIDs []string) (userList []*plugin.UserCenterBasicUserInfo, err error)
func (*UserCenter) UserSettings ¶
func (uc *UserCenter) UserSettings(externalID string) (userSettings *plugin.SettingInfo, err error)
func (*UserCenter) UserStatus ¶
func (uc *UserCenter) UserStatus(externalID string) (userStatus plugin.UserStatus)
type UserCenterConfig ¶
type UserConfig ¶
type UserConfigCache ¶
func NewUserConfigCache ¶
func NewUserConfigCache() *UserConfigCache
func (*UserConfigCache) SetUserConfig ¶
func (ucc *UserConfigCache) SetUserConfig(userID string, config *UserConfig)
type UserDetailInfo ¶
type UserDetailInfo struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
Userid string `json:"userid"`
Name string `json:"name"`
Department []int `json:"department"`
Position string `json:"position"`
Status int `json:"status"`
Isleader int `json:"isleader"`
EnglishName string `json:"english_name"`
Telephone string `json:"telephone"`
Enable int `json:"enable"`
HideMobile int `json:"hide_mobile"`
Order []int `json:"order"`
MainDepartment int `json:"main_department"`
Alias string `json:"alias"`
}
type UserInfo ¶
type UserInfo struct {
Userid string `json:"userid"`
Mobile string `json:"mobile"`
Gender string `json:"gender"`
Email string `json:"email"`
BizEmail string `json:"biz_mail"`
Avatar string `json:"avatar"`
QrCode string `json:"qr_code"`
Address string `json:"address"`
Name string `json:"name"`
DepartmentIDs []int `json:"department"`
Position string `json:"position"`
IsAvailable bool `json:"is_available"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
