Documentation ¶
Index ¶
- Constants
- type ChatInfo
- type ChatMarkdownMsg
- type ChatResponse
- type ChatTextMsg
- type Client
- func (wx *Client) AllDept() ([]Department, error)
- func (wx *Client) ChatMarkdownPush(ChatId, content string) error
- func (wx *Client) ChatTextPush(ChatId, content string) error
- func (wx *Client) CreateChat(name, chatId string, users []string) error
- func (wx *Client) DeptByID(departmentID string) ([]Department, error)
- func (wx *Client) Get(api string, params ...string) ([]byte, error)
- func (wx *Client) GetChat(chatId string) (ChatInfo, error)
- func (wx *Client) Post(api string, data []byte) ([]byte, error)
- func (wx *Client) SetRetry(reTry int) *Client
- func (wx *Client) UpdateChat(name, chatId, owner string, addUsers, delUsers []string) error
- func (wx *Client) Use(handlerFunc ...HandlerFunc) *Client
- func (wx *Client) UserByID(userID string) (UserDetail, error)
- func (wx *Client) UserMarkdownPush(users, content string) error
- func (wx *Client) UserTextPush(users, content string) error
- func (wx *Client) UsersByDeptID(departmentID string) ([]UserDetail, error)
- type Department
- type DepartmentList
- type HandlerFunc
- type HandlersChan
- type UserDetail
- type UserListResponse
- type UserMarkdownMsg
- type UserTextMsg
Constants ¶
View Source
const ( ErrorTokenNotFound = 41001 // 没有token ErrorToken = 40014 // token不合法 ErrorSystemBusy = -1 // 系统繁忙 )
企业微信错误码
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatInfo ¶
type ChatInfo struct { ChatId string `json:"chatid"` Name string `json:"name"` Owner string `json:"owner"` UserList []string `json:"userlist"` }
ChatInfo 群聊详情
type ChatMarkdownMsg ¶
type ChatMarkdownMsg struct { Markdown struct { Content string `json:"content"` } `json:"markdown"` // contains filtered or unexported fields }
ChatMarkdownMsg 群聊Markdown消息推送参数
type ChatResponse ¶
type ChatResponse struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"` ChatInfos ChatInfo `json:"chat_info"` }
ChatResponse chat api response
type ChatTextMsg ¶
type ChatTextMsg struct { Text struct { Content string `json:"content"` } `json:"text"` // contains filtered or unexported fields }
ChatTextMsg 群聊文本消息推送参数
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 企业微信client
func (*Client) ChatMarkdownPush ¶
ChatMarkdownPush 群聊Markdown消息推送
func (*Client) ChatTextPush ¶
ChatTextPush 群聊文本消息推送
func (*Client) CreateChat ¶
CreateChat 创建群聊
func (*Client) DeptByID ¶
func (wx *Client) DeptByID(departmentID string) ([]Department, error)
DeptByID 通过部门id获取部门详情
func (*Client) UpdateChat ¶
UpdateChat 更新群聊
func (*Client) Use ¶
func (wx *Client) Use(handlerFunc ...HandlerFunc) *Client
Use 增加返回错误码处理中间件 @Param HandlerFunc
func (*Client) UserByID ¶
func (wx *Client) UserByID(userID string) (UserDetail, error)
UserByID 通过user_id获取用户详情
func (*Client) UserMarkdownPush ¶
UserMarkdownPush 私信Markdown消息推送
func (*Client) UserTextPush ¶
UserTextPush 私信文本消息推送
func (*Client) UsersByDeptID ¶
func (wx *Client) UsersByDeptID(departmentID string) ([]UserDetail, error)
UsersByDeptID 通过部门id获取用户详情
type Department ¶
type Department struct { Id int `json:"id"` Name string `json:"name"` NameEn string `json:"name_en"` ParentID int `json:"parentid"` Order int `json:"order"` }
Department 部门详情
type DepartmentList ¶
type DepartmentList struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"` Department []Department `json:"department"` }
DepartmentList 部门详情列表
type HandlerFunc ¶
HandlerFunc api response 钩子函数
type UserDetail ¶
type UserDetail struct { Userid string `json:"userid" ` Name string `json:"name"` Department []int `json:"department"` Order []int `json:"order"` Position string `json:"position"` Mobile string `json:"mobile"` Gender string `json:"gender"` Email string `json:"email"` IsLeaderInDept []int `json:"is_leader_in_dept"` Avatar string `json:"avatar"` ThumbAvatar string `json:"thumb_avatar"` Telephone string `json:"telephone"` Alias string `json:"alias"` Address string `json:"address"` OpenUserid string `json:"open_userid"` MainDepartment int `json:"main_department"` ExtAttr struct { Attrs []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"` } `json:"attrs"` } `json:"extattr"` Status int `json:"status"` QrCode string `json:"qr_code"` ExternalPosition string `json:"external_position"` ExternalProfile struct { ExternalCorpName string `json:"external_corp_name"` WechatChannels struct { Nickname string `json:"nickname"` Status int `json:"status"` } `json:"wechat_channels"` ExternalAttr []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"` MiniProgram struct { Appid string `json:"appid"` Pagepath string `json:"pagepath"` Title string `json:"title"` } `json:"miniprogram,omitempty"` } `json:"external_attr"` } `json:"external_profile"` }
UserDetail 用户详情
type UserListResponse ¶
type UserListResponse struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"` UserList []UserDetail `json:"userlist"` }
UserListResponse 用户详情列表
type UserMarkdownMsg ¶
type UserMarkdownMsg struct { Markdown struct { Content string `json:"content"` } `json:"markdown"` // contains filtered or unexported fields }
UserMarkdownMsg 用户私信Markdown消息参数
type UserTextMsg ¶
type UserTextMsg struct { Text struct { Content string `json:"content"` } `json:"text"` // contains filtered or unexported fields }
UserTextMsg 用户私信文本消息参数
Source Files ¶
Click to show internal directories.
Click to hide internal directories.