Documentation
¶
Index ¶
- type Attr
- type BatchCallback
- type BatchResult
- type BatchResultItem
- type Contact
- type CreateDepartmentRequest
- type CreateUserRequest
- type Department
- func (d *Department) Create(dept CreateDepartmentRequest) (int, error)
- func (d *Department) Delete(id int) error
- func (d *Department) Get(id int) (*DepartmentInfo, error)
- func (d *Department) List(id int) ([]DepartmentInfo, error)
- func (d *Department) SimpleList(id int) ([]DepartmentIdInfo, error)
- func (d *Department) Update(dept UpdateDepartmentRequest) error
- type DepartmentIdInfo
- type DepartmentInfo
- type Export
- func (e *Export) Department(blockSize int) (string, error)
- func (e *Export) GetResult(jobId string) (*ExportResult, error)
- func (e *Export) SimpleUser(blockSize int) (string, error)
- func (e *Export) TagUser(blockSize int, tagId int) (string, error)
- func (e *Export) User(blockSize int) (string, error)
- type ExportDataItem
- type ExportResult
- type ExtAttr
- type ExternalProfile
- type Import
- func (i *Import) GetResult(jobId string) (*BatchResult, error)
- func (i *Import) ReplaceParty(mediaId string, callback *BatchCallback) (string, error)
- func (i *Import) ReplaceUser(mediaId string, toInvite bool, callback *BatchCallback) (string, error)
- func (i *Import) SyncUser(mediaId string, toInvite bool, callback *BatchCallback) (string, error)
- type InviteResult
- type SimpleUser
- type Tag
- func (t *Tag) AddTagUsers(tagId int, userList []string, partyList []int) (*TagMemberResult, error)
- func (t *Tag) Create(tagName string, tagId int) (int, error)
- func (t *Tag) DelTagUsers(tagId int, userList []string, partyList []int) (*TagMemberResult, error)
- func (t *Tag) Delete(tagId int) error
- func (t *Tag) Get(tagId int) (*TagDetail, error)
- func (t *Tag) List() ([]TagInfo, error)
- func (t *Tag) Update(tagId int, tagName string) error
- type TagDetail
- type TagInfo
- type TagMemberResult
- type TagUserInfo
- type UpdateDepartmentRequest
- type UpdateUserRequest
- type User
- func (u *User) BatchDelete(useridList []string) error
- func (u *User) ConvertToOpenid(userid string) (string, error)
- func (u *User) ConvertToUserid(openid string) (string, error)
- func (u *User) Create(user CreateUserRequest) error
- func (u *User) Delete(userid string) error
- func (u *User) DetailList(departmentId int) ([]UserInfo, error)
- func (u *User) Get(userid string) (*UserInfo, error)
- func (u *User) GetUseridByEmail(email string, emailType int) (string, error)
- func (u *User) GetUseridByMobile(mobile string) (string, error)
- func (u *User) Invite(userIds []string, partyIds []int, tagIds []int) (*InviteResult, error)
- func (u *User) ListId(cursor string, limit int) (*UserIdList, error)
- func (u *User) SimpleList(departmentId int) ([]SimpleUser, error)
- func (u *User) Update(user UpdateUserRequest) error
- type UserIdItem
- type UserIdList
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attr ¶
type Attr struct {
Type int `json:"type"`
Name string `json:"name"`
Text *struct {
Value string `json:"value"`
} `json:"text,omitempty"`
Web *struct {
Url string `json:"url"`
Title string `json:"title"`
} `json:"web,omitempty"`
}
Attr 扩展属性
type BatchCallback ¶
type BatchCallback struct {
Url string `json:"url"`
Token string `json:"token"`
EncodingAesKey string `json:"encodingaeskey"`
}
BatchCallback 异步任务回调信息
type BatchResult ¶
type BatchResult struct {
Status int `json:"status"`
Type string `json:"type"`
Total int `json:"total"`
Percentage int `json:"percentage"`
Result []BatchResultItem `json:"result"`
}
BatchResult 异步任务结果
type BatchResultItem ¶
type BatchResultItem struct {
Userid string `json:"userid,omitempty"`
Action int `json:"action"`
ErrCode int64 `json:"errcode"`
ErrMsg string `json:"errmsg"`
PartyId int `json:"partyid,omitempty"`
}
BatchResultItem 异步任务结果项
type CreateDepartmentRequest ¶
type CreateDepartmentRequest struct {
Name string `json:"name"`
NameEn string `json:"name_en,omitempty"`
Parentid int `json:"parentid"`
Order int `json:"order,omitempty"`
Id int `json:"id,omitempty"`
}
CreateDepartmentRequest 创建部门请求
type CreateUserRequest ¶
type CreateUserRequest struct {
Userid string `json:"userid"`
Name string `json:"name"`
Alias string `json:"alias,omitempty"`
Mobile string `json:"mobile,omitempty"`
Department []int `json:"department"`
Order []int `json:"order,omitempty"`
Position string `json:"position,omitempty"`
Gender string `json:"gender,omitempty"`
Email string `json:"email,omitempty"`
BizMail string `json:"biz_mail,omitempty"`
IsLeaderInDept []int `json:"is_leader_in_dept,omitempty"`
DirectLeader []string `json:"direct_leader,omitempty"`
Enable int `json:"enable,omitempty"`
AvatarMediaid string `json:"avatar_mediaid,omitempty"`
Telephone string `json:"telephone,omitempty"`
Address string `json:"address,omitempty"`
MainDepartment int `json:"main_department,omitempty"`
Extattr *ExtAttr `json:"extattr,omitempty"`
ToInvite *bool `json:"to_invite,omitempty"`
ExternalPosition string `json:"external_position,omitempty"`
ExternalProfile *ExternalProfile `json:"external_profile,omitempty"`
}
CreateUserRequest 创建成员请求
type Department ¶
type Department struct {
// contains filtered or unexported fields
}
Department 部门管理
func NewDepartment ¶
func NewDepartment(account contracts.AccountInterface) *Department
func (*Department) Create ¶
func (d *Department) Create(dept CreateDepartmentRequest) (int, error)
Create 创建部门
func (*Department) SimpleList ¶
func (d *Department) SimpleList(id int) ([]DepartmentIdInfo, error)
SimpleList 获取子部门ID列表
func (*Department) Update ¶
func (d *Department) Update(dept UpdateDepartmentRequest) error
Update 更新部门
type DepartmentIdInfo ¶
type DepartmentIdInfo struct {
Id int `json:"id"`
Parentid int `json:"parentid"`
Order int `json:"order"`
}
DepartmentIdInfo 子部门ID信息
type DepartmentInfo ¶
type DepartmentInfo struct {
Id int `json:"id"`
Name string `json:"name"`
NameEn string `json:"name_en"`
DepartmentLeader []string `json:"department_leader"`
Parentid int `json:"parentid"`
Order int `json:"order"`
}
DepartmentInfo 部门信息
type Export ¶
type Export struct {
// contains filtered or unexported fields
}
Export 异步导出
func (*Export) Department ¶
Department 导出部门
func (*Export) GetResult ¶
func (e *Export) GetResult(jobId string) (*ExportResult, error)
GetResult 获取导出结果
func (*Export) SimpleUser ¶
SimpleUser 导出成员
type ExportDataItem ¶
type ExportDataItem struct {
Url string `json:"url"`
Size int `json:"size"`
Md5 string `json:"md5"`
}
ExportDataItem 导出文件项
type ExportResult ¶
type ExportResult struct {
Status int `json:"status"`
DataList []ExportDataItem `json:"data_list"`
}
ExportResult 导出结果
type ExternalProfile ¶
type ExternalProfile struct {
ExternalCorpName string `json:"external_corp_name,omitempty"`
WechatChannels *struct {
Nickname string `json:"nickname"`
} `json:"wechat_channels,omitempty"`
ExternalAttr []Attr `json:"external_attr,omitempty"`
}
ExternalProfile 对外职务信息
type Import ¶
type Import struct {
// contains filtered or unexported fields
}
Import 异步导入
func NewImport ¶
func NewImport(account contracts.AccountInterface) *Import
func (*Import) GetResult ¶
func (i *Import) GetResult(jobId string) (*BatchResult, error)
GetResult 获取异步任务结果
func (*Import) ReplaceParty ¶
func (i *Import) ReplaceParty(mediaId string, callback *BatchCallback) (string, error)
ReplaceParty 全量覆盖部门
func (*Import) ReplaceUser ¶
func (i *Import) ReplaceUser(mediaId string, toInvite bool, callback *BatchCallback) (string, error)
ReplaceUser 全量覆盖成员
type InviteResult ¶
type InviteResult struct {
InvalidUser []string `json:"invaliduser"`
InvalidParty []int `json:"invalidparty"`
InvalidTag []int `json:"invalidtag"`
}
InviteResult 邀请成员结果
type SimpleUser ¶
type SimpleUser struct {
Userid string `json:"userid"`
Name string `json:"name"`
Department []int `json:"department"`
OpenUserid string `json:"open_userid"`
}
SimpleUser 部门成员简要信息
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag 标签管理
func NewTag ¶
func NewTag(account contracts.AccountInterface) *Tag
func (*Tag) AddTagUsers ¶
AddTagUsers 增加标签成员
func (*Tag) DelTagUsers ¶
DelTagUsers 删除标签成员
type TagDetail ¶
type TagDetail struct {
TagName string `json:"tagname"`
UserList []TagUserInfo `json:"userlist"`
PartyList []int `json:"partylist"`
}
TagDetail 标签详情(含成员列表)
type TagMemberResult ¶
type TagMemberResult struct {
InvalidList string `json:"invalidlist"`
InvalidParty []int `json:"invalidparty"`
}
TagMemberResult 标签成员操作结果
type TagUserInfo ¶
TagUserInfo 标签成员信息
type UpdateDepartmentRequest ¶
type UpdateDepartmentRequest struct {
Id int `json:"id"`
Name string `json:"name,omitempty"`
NameEn string `json:"name_en,omitempty"`
Parentid int `json:"parentid,omitempty"`
Order int `json:"order,omitempty"`
}
UpdateDepartmentRequest 更新部门请求
type UpdateUserRequest ¶
type UpdateUserRequest struct {
Userid string `json:"userid"`
Name string `json:"name,omitempty"`
Alias string `json:"alias,omitempty"`
Mobile string `json:"mobile,omitempty"`
Department []int `json:"department,omitempty"`
Order []int `json:"order,omitempty"`
Position string `json:"position,omitempty"`
Gender string `json:"gender,omitempty"`
Email string `json:"email,omitempty"`
BizMail string `json:"biz_mail,omitempty"`
IsLeaderInDept []int `json:"is_leader_in_dept,omitempty"`
DirectLeader []string `json:"direct_leader,omitempty"`
Enable int `json:"enable,omitempty"`
AvatarMediaid string `json:"avatar_mediaid,omitempty"`
Telephone string `json:"telephone,omitempty"`
Address string `json:"address,omitempty"`
MainDepartment int `json:"main_department,omitempty"`
Extattr *ExtAttr `json:"extattr,omitempty"`
ExternalPosition string `json:"external_position,omitempty"`
ExternalProfile *ExternalProfile `json:"external_profile,omitempty"`
}
UpdateUserRequest 更新成员请求
type User ¶
type User struct {
// contains filtered or unexported fields
}
User 通讯录成员管理
func NewUser ¶
func NewUser(account contracts.AccountInterface) *User
func (*User) ConvertToOpenid ¶
ConvertToOpenid userid转openid
func (*User) ConvertToUserid ¶
ConvertToUserid openid转userid
func (*User) DetailList ¶
DetailList 获取部门成员详情
func (*User) GetUseridByEmail ¶
GetUseridByEmail 邮箱获取userid
func (*User) GetUseridByMobile ¶
GetUseridByMobile 手机号获取userid
func (*User) ListId ¶
func (u *User) ListId(cursor string, limit int) (*UserIdList, error)
ListId 获取成员ID列表
func (*User) SimpleList ¶
func (u *User) SimpleList(departmentId int) ([]SimpleUser, error)
SimpleList 获取部门成员
type UserIdItem ¶
UserIdItem 成员ID项
type UserIdList ¶
type UserIdList struct {
NextCursor string `json:"next_cursor"`
DeptUser []UserIdItem `json:"dept_user"`
}
UserIdList 成员ID列表
type UserInfo ¶
type UserInfo struct {
Userid string `json:"userid"`
Name string `json:"name"`
Alias string `json:"alias"`
Mobile string `json:"mobile"`
Department []int `json:"department"`
Order []int `json:"order"`
Position string `json:"position"`
Gender string `json:"gender"`
Email string `json:"email"`
BizMail string `json:"biz_mail"`
IsLeaderInDept []int `json:"is_leader_in_dept"`
DirectLeader []string `json:"direct_leader"`
Avatar string `json:"avatar"`
ThumbAvatar string `json:"thumb_avatar"`
Telephone string `json:"telephone"`
Address string `json:"address"`
OpenUserid string `json:"open_userid"`
MainDepartment int `json:"main_department"`
Extattr ExtAttr `json:"extattr"`
Status int `json:"status"`
QrCode string `json:"qr_code"`
ExternalPosition string `json:"external_position"`
ExternalProfile *ExternalProfile `json:"external_profile"`
}
UserInfo 成员详细信息