1 Star 0 Fork 0

h79/gothird

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model.go 16.43 KB
一键复制 编辑 原始数据 按行查看 历史
huqiuyun 提交于 2年前 . 企微授权接口
package structs
type Department struct {
Id int64 `json:"id"`
ParentId int64 `json:"parentid,omitempty"`
Order int `json:"order,omitempty"`
Name string `json:"name,omitempty"`
NameEn string `json:"name_en,omitempty"`
Leader []string `json:"department_leader,omitempty"`
}
type DepartmentId struct {
Id int64 `json:"id"`
ParentId int64 `json:"parentid"`
Order int `json:"order"`
}
type DepUser struct {
OpenUserId string `json:"open_userid"`
Department int64 `json:"department"`
}
type SimpleUser struct {
Userid string `json:"userid"`
Name string `json:"name"`
OpenUserid string `json:"open_userid"`
Department []int64 `json:"department"`
}
type UserInfo struct {
Userid string `json:"userid"`
Name string `json:"name"`
Gender string `json:"gender"`
Avatar string `json:"avatar"`
QrCode string `json:"qr_code"`
Mobile string `json:"mobile"`
Email string `json:"email"`
BizMail string `json:"biz_mail"`
Address string `json:"address"`
}
type UserInfoWithCode struct {
Userid string `json:"userid"`
OpenId string `json:"openid"`
}
type UserIdReq struct {
UseridList []string `json:"userid_list"`
}
type OpenUserId struct {
OpenUseridList []OpenUserIdInfo `json:"open_userid_list"`
InvalidUseridList []string `json:"invalid_userid_list"`
}
type OpenUserIdInfo struct {
Userid string `json:"userid"`
OpenUserid string `json:"open_userid"`
}
type ExternalUserIds struct {
Items []ExternalUserIdItem `json:"items"`
}
type ExternalUserIdItem struct {
ExternalUserid string `json:"external_userid"`
NewExternalUserid string `json:"new_external_userid"`
}
type BatchUserId struct {
UseridList []string `json:"userid_list"`
Cursor string `json:"cursor"`
Limit int `json:"limit"`
}
type BatchUserIdRes struct {
ExternalContactList []ExternalContactDetail `json:"external_contact_list"`
NextCursor string `json:"next_cursor"`
}
type FollowUser struct {
Userid string `json:"userid"` //添加了此外部联系人的企业成员userid
Remark string `json:"remark"` //该成员对此外部联系人的备注
Description string `json:"description"`
Tags []Tag `json:"tags,omitempty"`
TagIds []string `json:"tag_id,omitempty"`
RemarkMobiles []string `json:"remark_mobiles,omitempty"` //该成员对此客户备注的手机号码,代开发自建应用需要管理员授权才可以获取,第三方不可获取,上游企业不可获取下游企业客户该字段
RemarkCorpName string `json:"remark_corp_name,omitempty"` //该成员对此微信客户备注的企业名称(仅微信客户有该字段)
OperUserid string `json:"oper_userid"`
State string `json:"state,omitempty"`
CreateTime int64 `json:"createtime"`
AddWay int `json:"add_way"` //该成员添加此客户的来源
WechatChannels *WechatChannels `json:"wechat_channels,omitempty"`
}
// add_way表示添加客户的来源,有固定的值,而state表示此客户的渠道,可以由企业进行自定义的配置,请注意二者的不同。
//
// 值 含义
// 0 未知来源
// 1 扫描二维码
// 2 搜索手机号
// 3 名片分享
// 4 群聊
// 5 手机通讯录
// 6 微信联系人
// 8 安装第三方应用时自动添加的客服人员
// 9 搜索邮箱
// 10 视频号添加
// 11 通过日程参与人添加
// 12 通过会议参与人添加
// 13 添加微信好友对应的企业微信
// 14 通过智慧硬件专属客服添加
// 15 通过上门服务客服添加
// 201 内部成员共享
// 202 管理员/负责人分配
const (
Kway = 0
)
type Tag struct {
GroupName string `json:"group_name"`
TagName string `json:"tag_name"`
TagId string `json:"tag_id"`
Type int `json:"type"`
}
type WechatChannels struct {
Nickname string `json:"nickname"`
Source int `json:"source,omitempty"`
}
type ExternalProfile struct {
ExternalAttr []Attribute `json:"external_attr,omitempty"`
WechatChannels WechatChannels `json:"wechat_channels,omitempty"`
ExternalCorpName string `json:"external_corp_name,omitempty"`
}
type Attribute struct {
Type int `json:"type"`
Name string `json:"name"`
Text *AttributeText `json:"text,omitempty"`
Web *AttributeWeb `json:"web,omitempty"`
MiniProgram *AttributeMiniProgram `json:"miniprogram,omitempty"`
}
type AttributeText struct {
Value string `json:"value"`
}
type AttributeWeb struct {
Url string `json:"url"`
Title string `json:"title"`
}
type AttributeMiniProgram struct {
Appid string `json:"appid"`
PagePath string `json:"pagepath"`
Title string `json:"title"`
}
type ExternalContact struct {
ExternalUserid string `json:"external_userid"`
Name string `json:"name"`
Position string `json:"position"`
Avatar string `json:"avatar"`
CorpName string `json:"corp_name"`
CorpFullName string `json:"corp_full_name"`
UnionId string `json:"unionid"`
Type int `json:"type"`
Gender int `json:"gender"`
ExternalProfile *ExternalProfile `json:"external_profile,omitempty"`
}
type ExternalContactDetail struct {
ExternalContact ExternalContact `json:"external_contact"`
FollowInfo *FollowUser `json:"follow_info,omitempty"` //for batch
FollowUser []FollowUser `json:"follow_user,omitempty"` // for detail
}
type ExternalRemark struct {
Userid string `json:"userid"`
ExternalUserid string `json:"external_userid"`
Remark string `json:"remark"`
Description string `json:"description"`
RemarkCompany string `json:"remark_company"`
RemarkPicMediaId string `json:"remark_pic_mediaid"`
RemarkMobiles []string `json:"remark_mobiles"`
}
type DepMember struct {
Userid string `json:"userid"`
Name string `json:"name,omitempty"`
Alias string `json:"alias,omitempty"`
Mobile string `json:"mobile,omitempty"`
Position string `json:"position,omitempty"`
Gender string `json:"gender,omitempty"`
Email string `json:"email,omitempty"`
BizMail string `json:"biz_mail,omitempty"`
AvatarMediaId string `json:"avatar_mediaid,omitempty"`
OpenUserid string `json:"open_userid,omitempty"`
Avatar string `json:"avatar,omitempty"`
ThumbAvatar string `json:"thumb_avatar,omitempty"`
Telephone string `json:"telephone,omitempty"`
Address string `json:"address,omitempty"`
QrCode string `json:"qr_code,omitempty"`
ExternalPosition string `json:"external_position"`
ToInvite bool `json:"to_invite,omitempty"`
Enable int `json:"enable"`
Status int `json:"status,omitempty"`
MainDepartment int64 `json:"main_department"`
Department []int64 `json:"department,omitempty"`
IsLeaderInDept []int64 `json:"is_leader_in_dept,omitempty"`
Order []int `json:"order,omitempty"`
DirectLeader []string `json:"direct_leader,omitempty"`
Extattr *Attribute `json:"extattr,omitempty"`
ExternalProfile *ExternalProfile `json:"external_profile,omitempty"`
}
type TagGroup struct {
GroupId string `json:"group_id"`
GroupName string `json:"group_name"`
CreateTime int64 `json:"create_time"`
Order int `json:"order"`
StrategyId int `json:"strategy_id,omitempty"`
Deleted bool `json:"deleted"`
Tag []TagGroupItem `json:"tag"`
}
type TagGroupItem struct {
Id string `json:"id"`
Name string `json:"name"`
CreateTime int64 `json:"create_time"`
Order int `json:"order"`
Deleted bool `json:"deleted"`
}
type AddTagReq struct {
GroupId string `json:"group_id"`
GroupName string `json:"group_name"`
Order int `json:"order"`
AgentId int64 `json:"agentid,omitempty"` //授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
Tag []TagInfo `json:"tag"`
}
type AddStrategyTagReq struct {
AddTagReq
StrategyId int `json:"strategy_id"`
}
type TagInfo struct {
Name string `json:"name"`
Order int `json:"order"`
}
type EditTagReq struct {
Id string `json:"id"`
Name string `json:"name"`
Order int `json:"order"`
AgentId int64 `json:"agentid,omitempty"` //授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
}
type MarkTagReq struct {
Userid string `json:"userid"`
ExternalUserid string `json:"external_userid"`
AddTag []string `json:"add_tag,omitempty"`
RemoveTag []string `json:"remove_tag,omitempty"`
}
type TagId struct {
TagId []string `json:"tag_id,omitempty"`
GroupId []string `json:"group_id,omitempty"`
}
type ExternalGroupListReq struct {
OwnerFilter OwnerFilter `json:"owner_filter"`
Cursor string `json:"cursor"`
Limit int `json:"limit"`
StatusFilter int `json:"status_filter"`
}
type OwnerFilter struct {
UseridList []string `json:"userid_list"`
}
type GroupChat struct {
ChatId string `json:"chat_id"`
Status int `json:"status"`
}
type GroupChatDetail struct {
ChatId string `json:"chat_id"`
Name string `json:"name"`
Owner string `json:"owner"`
Notice string `json:"notice"`
CreateTime int64 `json:"create_time"`
MemberList []GroupMember `json:"member_list"`
AdminList []GroupAdmin `json:"admin_list"`
}
type GroupMember struct {
Userid string `json:"userid"`
Type int `json:"type"`
JoinScene int `json:"join_scene"`
JoinTime int64 `json:"join_time"`
Invitor Invitor `json:"invitor,omitempty"`
GroupNickname string `json:"group_nickname"`
Name string `json:"name"`
Unionid string `json:"unionid,omitempty"`
}
type Invitor struct {
Userid string `json:"userid"`
}
type GroupAdmin struct {
Userid string `json:"userid"`
}
type GroupMsgReq struct {
ChatType string `json:"chat_type"` //群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
Creator string `json:"creator"`
Cursor string `json:"cursor"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
FilterType int `json:"filter_type"`
Limit int `json:"limit"`
}
type GroupMsg struct {
MsgId string `json:"msgid"`
Creator string `json:"creator"`
CreateTime string `json:"create_time"`
CreateType int `json:"create_type"`
Text *ExText `json:"text,omitempty"`
Attachments []Attachment `json:"attachments"`
}
type Attachment struct {
MsgType string `json:"msgtype"`
Image *ExImage `json:"image,omitempty"`
Link *ExLink `json:"link,omitempty"`
Program *ExProgram `json:"miniprogram,omitempty"`
Video *ExVideo `json:"video,omitempty"`
File *ExFile `json:"file,omitempty"`
}
type NewExternalUserid struct {
ExternalUserid string `json:"external_userid"`
NewExternalUserid string `json:"new_external_userid"`
}
type RoomInfo struct {
RoomName string `json:"roomname"`
Creator string `json:"creator"`
Notice string `json:"notice"`
RoomCreateTime int64 `json:"room_create_time"`
Members []RoomMember `json:"members"`
}
type RoomMember struct {
MemberId string `json:"memberid"`
JoinTime int64 `json:"jointime"`
}
type SingleAgree struct {
Userid string `json:"userid"`
ExternalOpenId string `json:"externalopenid"`
}
type AgreeInfo struct {
StatusChangeTime int64 `json:"status_change_time"`
Userid string `json:"userid"`
ExternalOpenId string `json:"externalopenid"`
AgreeStatus string `json:"agree_status"`
}
// AgreeNotify 客户同意进行聊天内容存档事件回调
type AgreeNotify struct {
ToUserName string `json:"ToUserName" xml:"ToUserName"`
FromUserName string `json:"FromUserName" xml:"FromUserName"`
UserID string `json:"UserID" xml:"UserID"`
ExternalUserID string `json:"ExternalUserID" xml:"ExternalUserID"`
WelcomeCode string `json:"WelcomeCode" xml:"WelcomeCode"`
}
type AddMomentTask struct {
Text ExText `json:"text"` //不能与Attachment同时为空
Attachments []Attachment `json:"attachments"`
VisibleRange VisibleRange `json:"visible_range"`
}
type VisibleRange struct {
SenderList struct {
UserList []string `json:"user_list"`
DepartmentList []int `json:"department_list"`
} `json:"sender_list"`
ExternalContactList struct {
TagList []string `json:"tag_list"`
} `json:"external_contact_list"`
}
type MomentTaskResult struct {
Status int `json:"status"`
Type string `json:"type"`
Result struct {
ErrCode int `json:"errcode"`
ErrMsg string `json:"errmsg"`
MomentId string `json:"moment_id"`
InvalidSenderList struct {
UserList []string `json:"user_list"`
DepartmentList []int64 `json:"department_list"`
} `json:"invalid_sender_list"`
InvalidExternalContactList struct {
TagList []string `json:"tag_list"`
} `json:"invalid_external_contact_list"`
} `json:"result"`
}
type MomentListReq struct {
StartTime int `json:"start_time"`
EndTime int `json:"end_time"`
Creator string `json:"creator"`
FilterType int `json:"filter_type"`
Cursor string `json:"cursor"`
Limit int `json:"limit"`
}
type MomentListResp struct {
NextCursor string `json:"next_cursor"`
MomentList []MomentInfo `json:"moment_list"`
}
type MomentInfo struct {
MomentId string `json:"moment_id"`
Creator string `json:"creator"`
CreateTime int `json:"create_time"`
CreateType int `json:"create_type"`
VisibleType int `json:"visible_type"`
Text struct {
Content string `json:"content"`
} `json:"text"`
Image []struct {
MediaId string `json:"media_id"`
} `json:"image"`
Video struct {
MediaId string `json:"media_id"`
ThumbMediaId string `json:"thumb_media_id"`
} `json:"video"`
Link struct {
Title string `json:"title"`
Url string `json:"url"`
} `json:"link"`
Location struct {
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Name string `json:"name"`
} `json:"location"`
}
type ExternalUserIdInfo struct {
CorpId string `json:"corpid"`
ExternalUserid string `json:"external_userid"`
}
type Export struct {
EncodingAesKey string `json:"encoding_aeskey"`
BlockSize int `json:"block_size"`
}
type ExportResult struct {
Status int `json:"status"`
DataList []ExportItem `json:"data_list"`
}
type ExportItem struct {
Url string `json:"url"`
Size interface{} `json:"size"`
Md5 string `json:"md5"`
}
const (
KEBatchJobResult = "batch_job_result"
)
// ExportNotify 导出任务完成通知
type ExportNotify struct {
JobId string `json:"SuiteId" xml:"JobId"`
JobType string `json:"AuthCorpId" xml:"JobType"` //操作类型,字符串,在异步导出的场景下分别有:export_user(导出成员详情)、 export_simple_user(导出成员)、export_department(导出部门)、export_tag(导出标签成员)
ErrCode int `json:"ErrCode" xml:"ErrCode"`
ErrMsg string `json:"ErrMsg" xml:"ErrMsg"`
}
type ImportReq struct {
MediaId string `json:"media_id"`
ToInvite bool `json:"to_invite"`
Callback struct {
Url string `json:"url"`
Token string `json:"token"`
EncodingAesKey string `json:"encodingaeskey"`
} `json:"callback"`
}
type ImportResult struct {
Status int `json:"status"`
Type string `json:"type"`
Total int `json:"total"`
Percentage int `json:"percentage"`
Result []interface{} `json:"result"`
}
type MemberAuthResult struct {
NextCursor string `json:"next_cursor"`
MemberAuthList []struct {
OpenUserid string `json:"open_userid"`
} `json:"member_auth_list"`
}
type SelectedTicketResult struct {
OperatorOpenUserid string `json:"operator_open_userid"`
OpenUseridList []string `json:"open_userid_list"`
UnAuthOpenUseridList []string `json:"unauth_open_userid_list"`
Total int `json:"total"`
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/h79/gothird.git
git@gitee.com:h79/gothird.git
h79
gothird
gothird
v1.8.11

搜索帮助

371d5123 14472233 46e8bd33 14472233