Documentation ¶
Index ¶
- Constants
- type WxAccount
- func (w WxAccount) AddCustomerSupport(kfAccount string, nickname string) error
- func (w WxAccount) AddMaterial(title, introduction, mediaType string, mediaFile *os.File) (*common.Material, error)
- func (w WxAccount) AddNewsMaterial(news []common.News) (string, error)
- func (w WxAccount) AddTempMaterial(mediaType string, mediaFile *os.File) (*common.Material, error)
- func (w WxAccount) AddTempNewsMaterial(news []common.News) (*common.Material, error)
- func (w WxAccount) CheckAccessTokenValidFromWxServer(accessToken, openId string) error
- func (w WxAccount) CloseComment(msgDataId int, index ...int) error
- func (w WxAccount) CloseCustomerSupportSession(kfAccount string, openId string) error
- func (w WxAccount) CreateConditionMenu(m menu.Menu) error
- func (w WxAccount) CreateMenu(menu menu.Menu) error
- func (w WxAccount) CreateQRLimitScene(sceneId int, expireSeconds ...int) (map[string]interface{}, error)
- func (w WxAccount) CreateQRLimitStrScene(sceneStr string, expireSeconds ...int) (map[string]interface{}, error)
- func (w WxAccount) CreateQRScene(sceneId int, expireSeconds ...int) (map[string]interface{}, error)
- func (w WxAccount) CreateQRStrScene(sceneStr string, expireSeconds ...int) (map[string]interface{}, error)
- func (w WxAccount) CreateUserTag(tag user.WxUserTag) (*user.WxUserTag, error)
- func (w WxAccount) CustomerSupportTyping(openId string) error
- func (w WxAccount) DeleteComment(msgDataId, index, userCommentId int) error
- func (w WxAccount) DeleteConditionMenu(menuId string) error
- func (w WxAccount) DeleteCustomerSupport(kfAccount string) error
- func (w WxAccount) DeleteMaterial(mediaId string) error
- func (w WxAccount) DeleteMenu() error
- func (w WxAccount) DeleteMsg(msgId string, articleIndex ...int) error
- func (w WxAccount) DeleteReply(msgDataId, index, userCommentId int, content string) error
- func (w WxAccount) DeleteUserTag(tag user.WxUserTag) error
- func (c *WxAccount) FetchAccessToken() error
- func (w WxAccount) GenerateAuthHandleFunc(redirectUrl string, state string, isSilent bool) func(http.ResponseWriter, *http.Request)
- func (w WxAccount) GenerateAuthRedirectHandleFunc(fn func(code, state string)) func(http.ResponseWriter, *http.Request)
- func (w WxAccount) GenerateAuthUrl(redirectUrl string, state string, isSilent bool) string
- func (c *WxAccount) GetAccessToken() string
- func (w WxAccount) GetAllCustomerSupport() ([]customerSupport.WxCustomerSupport, error)
- func (w WxAccount) GetAllCustomerSupportSession(kfAccount string) ([]customerSupport.WxCustomerSupportSession, error)
- func (w WxAccount) GetAllMenu() (menu.Menu, error)
- func (c *WxAccount) GetAppId() string
- func (w WxAccount) GetComment(msgDataId, index, begin, count, commentType int) (int, []common.Comment, error)
- func (w WxAccount) GetCustomerSupportMsgRecord(startTime, endTime, msgId, number int) (list []customerSupport.WxCustomerSupportMsgRecord, listNumber int, ...)
- func (w WxAccount) GetCustomerSupportSession(openId string) (*customerSupport.WxCustomerSupportSession, error)
- func (w WxAccount) GetMaterial(mediaId string) (*common.Material, error)
- func (w WxAccount) GetMaterialBatch(materialType string, offset, count int) ([]common.Material, int, int, error)
- func (w WxAccount) GetMaterialCount() (map[string]int, error)
- func (w WxAccount) GetMenu() (*menu.Menu, []menu.Menu, error)
- func (w WxAccount) GetMsgStatus(msgId string) (string, error)
- func (w WxAccount) GetOnLineCustomerSupport() ([]customerSupport.WxCustomerSupport, error)
- func (c *WxAccount) GetServerIpList() ([]string, error)
- func (w WxAccount) GetSubscribeUser(nextOpenId ...string) (map[string]interface{}, error)
- func (w WxAccount) GetTagListOfUser(user user.WxUser) ([]int, error)
- func (w WxAccount) GetTempMaterial(mediaId string) (*common.Material, error)
- func (w WxAccount) GetUserAccessToken(code string) (map[string]interface{}, error)
- func (w WxAccount) GetUserInfo(oauthToken string, query WxUserQuery) (*WxUser, error)
- func (w WxAccount) GetUserInfoBatch(query []WxUserQuery) ([]WxUser, error)
- func (w WxAccount) GetUserListOfTag(tag user.WxUserTag, nextOpenId ...string) (map[string]interface{}, error)
- func (w WxAccount) GetUserTags() ([]user.WxUserTag, error)
- func (w WxAccount) GetWaitCustomerSupportSession() ([]customerSupport.WxCustomerSupportSession, int, error)
- func (w WxAccount) HandleMsg(content []byte) (string, error)
- func (w WxAccount) InviteBind(kfAccount string, inviteWx string) error
- func (c WxAccount) IsAccessTokenValid() bool
- func (w WxAccount) MatchConditionMenu(user user.WxUser) (*menu.Menu, error)
- func (w WxAccount) OpenComment(msgDataId int, index ...int) error
- func (w WxAccount) OpenCustomerSupportSession(kfAccount string, openId string) error
- func (w WxAccount) PreviewCard(toUserOpenId string, cardId string, toWxName ...string) (msgId int, err error)
- func (w WxAccount) PreviewImage(toUserOpenId string, mediaIds []string, recommend string, toWxName ...string) (msgId int, err error)
- func (w WxAccount) PreviewNews(toUserOpenId string, mediaId string, toWxName ...string) (msgId int, err error)
- func (w WxAccount) PreviewText(toUserOpenId string, content string, toWxName ...string) (msgId int, err error)
- func (w WxAccount) PreviewVideo(toUserOpenId string, mediaId string, toWxName ...string) (msgId int, err error)
- func (w WxAccount) PreviewVoice(toUserOpenId string, mediaId string, toWxName ...string) (msgId int, err error)
- func (w WxAccount) RecommendComment(msgDataId, index, userCommentId int) error
- func (w WxAccount) RefreshUserAccessToken(refreshToken string) (map[string]interface{}, error)
- func (w WxAccount) RemarkUser(user WxUser) error
- func (w WxAccount) ReplyComment(msgDataId, index, userCommentId int, content string) error
- func (w WxAccount) Semantic(queryData map[string]interface{}, openId string) (map[string]interface{}, error)
- func (w WxAccount) SendCardByOpenId(toUserOpenIds []string, cardId string) (msgId int, err error)
- func (w WxAccount) SendCardByTag(tagId int, cardId string) (msgId int, err error)
- func (w WxAccount) SendCustomerSupportMsg(msg customerSupport.WxCustomerSupportMsg) error
- func (w WxAccount) SendImageByOpenId(toUserOpenIds []string, mediaIds []string, recommend string, ...) (msgId int, err error)
- func (w WxAccount) SendImageByTag(tagId int, mediaIds []string, recommend string, ...) (msgId int, err error)
- func (w WxAccount) SendNews(news []common.News) (*common.Material, error)
- func (w WxAccount) SendNewsByOpenId(toUserOpenIds []string, mediaId string, sendIgnoreReprint bool) (msgId, msgDataId int, err error)
- func (w WxAccount) SendNewsByTag(tagId int, mediaId string, sendIgnoreReprint bool) (msgId, msgDataId int, err error)
- func (w WxAccount) SendTemplateMsg(msg templateMsg.WxTemplateMsg) error
- func (w WxAccount) SendTextByOpenId(toUserOpenIds []string, content string) (msgId int, err error)
- func (w WxAccount) SendTextByTag(tagId int, content string) (msgId int, err error)
- func (w WxAccount) SendVideoByOpenId(toUserOpenIds []string, mediaId string) (msgId int, err error)
- func (w WxAccount) SendVideoByTag(tagId int, mediaId string) (msgId int, err error)
- func (w WxAccount) SendVoiceByOpenId(toUserOpenIds []string, mediaId string) (msgId int, err error)
- func (w WxAccount) SendVoiceByTag(tagId int, mediaId string) (msgId int, err error)
- func (w *WxAccount) SetEventMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
- func (w *WxAccount) SetImageMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
- func (w *WxAccount) SetLocationMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
- func (w *WxAccount) SetShortVideoMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
- func (w *WxAccount) SetTextMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
- func (w *WxAccount) SetVideoMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
- func (w *WxAccount) SetVoiceMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
- func (w WxAccount) ShortUrl(longUrl string) (string, error)
- func (w WxAccount) TagUserBatch(users []user.WxUser, tag user.WxUserTag) error
- func (w WxAccount) TicketToQrCodeImgByte(ticket string) ([]byte, error)
- func (w WxAccount) TicketToQrCodeImgFile(ticket string) (*os.File, error)
- func (w WxAccount) UnRecommendComment(msgDataId, index, userCommentId int) error
- func (w WxAccount) UnTagUserBatch(users []user.WxUser, tag user.WxUserTag) error
- func (w WxAccount) UpdateCustomerSupport(kfAccount string, nickname string) error
- func (w WxAccount) UpdateNewsMaterial(mediaId string, index int, news common.News) error
- func (w WxAccount) UpdateUserTag(tag user.WxUserTag) error
- func (w WxAccount) UploadCustomerSupportAvatar(kfAccount string, file *os.File) error
- func (w WxAccount) UploadNewsMaterialImg(imgFile *os.File) (string, error)
- func (w WxAccount) VerifyMsg(signature, timestamp, nonce string) bool
Constants ¶
const BaseUrl = "https://api.weixin.qq.com"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WxAccount ¶
微信公众号实体
func NewWxAccount ¶
func (WxAccount) AddCustomerSupport ¶
* 添加客服
func (WxAccount) AddMaterial ¶
func (w WxAccount) AddMaterial(title, introduction, mediaType string, mediaFile *os.File) (*common.Material, error)
添加其他类型永久素材
func (WxAccount) AddNewsMaterial ¶
添加永久图文素材
func (WxAccount) AddTempMaterial ¶
上传临时素材文件(只能上传 图片、视频、文字等)
func (WxAccount) AddTempNewsMaterial ¶
上传临时图文素材,该接口特殊,上传即群发
func (WxAccount) CheckAccessTokenValidFromWxServer ¶
检查token是否有效,
func (WxAccount) CloseComment ¶
关闭评论
func (WxAccount) CloseCustomerSupportSession ¶
* 关闭会话
func (WxAccount) CreateConditionMenu ¶
创建个性化菜单
func (WxAccount) CreateQRLimitScene ¶
func (w WxAccount) CreateQRLimitScene(sceneId int, expireSeconds ...int) (map[string]interface{}, error)
创建永久二维码
func (WxAccount) CreateQRLimitStrScene ¶
func (w WxAccount) CreateQRLimitStrScene(sceneStr string, expireSeconds ...int) (map[string]interface{}, error)
创建永久二维码
func (WxAccount) CreateQRStrScene ¶
func (w WxAccount) CreateQRStrScene(sceneStr string, expireSeconds ...int) (map[string]interface{}, error)
创建临时二维码
func (WxAccount) CreateUserTag ¶
func (WxAccount) CustomerSupportTyping ¶
更新正在输入状态
func (WxAccount) DeleteComment ¶
删除评论
func (WxAccount) DeleteConditionMenu ¶
删除个性化菜单
func (WxAccount) DeleteCustomerSupport ¶
* 删除客服
func (WxAccount) DeleteReply ¶
删除回复
func (WxAccount) GenerateAuthHandleFunc ¶
func (w WxAccount) GenerateAuthHandleFunc(redirectUrl string, state string, isSilent bool) func(http.ResponseWriter, *http.Request)
生成处理授权跳转的handleFunc
func (WxAccount) GenerateAuthRedirectHandleFunc ¶
func (w WxAccount) GenerateAuthRedirectHandleFunc(fn func(code, state string)) func(http.ResponseWriter, *http.Request)
生成处理回调的handleFunc
func (*WxAccount) GetAccessToken ¶
取出access_token,这里专门做成一个返回值的函数,忽略了拉去token的err,主要是为了方便直接使用
func (WxAccount) GetAllCustomerSupport ¶
func (w WxAccount) GetAllCustomerSupport() ([]customerSupport.WxCustomerSupport, error)
* 获取所有客服
func (WxAccount) GetAllCustomerSupportSession ¶
func (w WxAccount) GetAllCustomerSupportSession(kfAccount string) ([]customerSupport.WxCustomerSupportSession, error)
* 获取客服会话列表
func (WxAccount) GetComment ¶
func (w WxAccount) GetComment(msgDataId, index, begin, count, commentType int) (int, []common.Comment, error)
获取评论 index从0开始 type=0 普通评论&精选评论 type=1 普通评论 type=2 精选评论
func (WxAccount) GetCustomerSupportMsgRecord ¶
func (w WxAccount) GetCustomerSupportMsgRecord(startTime, endTime, msgId, number int) (list []customerSupport.WxCustomerSupportMsgRecord, listNumber int, nextMsgId int, err error)
* 获取聊天记录
func (WxAccount) GetCustomerSupportSession ¶
func (w WxAccount) GetCustomerSupportSession(openId string) (*customerSupport.WxCustomerSupportSession, error)
* 获取会话
func (WxAccount) GetMaterial ¶
获取永久素材
func (WxAccount) GetMaterialBatch ¶
func (w WxAccount) GetMaterialBatch(materialType string, offset, count int) ([]common.Material, int, int, error)
批量获取素材
func (WxAccount) GetMaterialCount ¶
获取素材总数
func (WxAccount) GetMsgStatus ¶
查询消息群发状态
func (WxAccount) GetOnLineCustomerSupport ¶
func (w WxAccount) GetOnLineCustomerSupport() ([]customerSupport.WxCustomerSupport, error)
* 获取在线客服
func (*WxAccount) GetServerIpList ¶
获取微信服务器ip
func (WxAccount) GetSubscribeUser ¶
获取关注用户列表
func (WxAccount) GetTagListOfUser ¶
获取用户身上的标签列表
func (WxAccount) GetTempMaterial ¶
获取临时素材文件(只能获取,图片、视频、文字等)
func (WxAccount) GetUserAccessToken ¶
通过code获取用户accesstoken与openid
func (WxAccount) GetUserInfo ¶
拉取个人信息
func (WxAccount) GetUserInfoBatch ¶
批量获取用户信息
func (WxAccount) GetUserListOfTag ¶
func (w WxAccount) GetUserListOfTag(tag user.WxUserTag, nextOpenId ...string) (map[string]interface{}, error)
获取标签下粉丝列表
func (WxAccount) GetWaitCustomerSupportSession ¶
func (w WxAccount) GetWaitCustomerSupportSession() ([]customerSupport.WxCustomerSupportSession, int, error)
* 获取未接入会话列表
func (WxAccount) InviteBind ¶
* 邀请绑定客服账号
func (WxAccount) IsAccessTokenValid ¶
验证access_token是否有效
func (WxAccount) MatchConditionMenu ¶
获取用户匹配的菜单
func (WxAccount) OpenComment ¶
开启评论
func (WxAccount) OpenCustomerSupportSession ¶
* 开启会话
func (WxAccount) PreviewCard ¶
func (w WxAccount) PreviewCard(toUserOpenId string, cardId string, toWxName ...string) (msgId int, err error)
预览发卡券消息
func (WxAccount) PreviewImage ¶
func (w WxAccount) PreviewImage(toUserOpenId string, mediaIds []string, recommend string, toWxName ...string) (msgId int, err error)
预览图片消息
func (WxAccount) PreviewNews ¶
func (w WxAccount) PreviewNews(toUserOpenId string, mediaId string, toWxName ...string) (msgId int, err error)
预览图文消息
func (WxAccount) PreviewText ¶
func (w WxAccount) PreviewText(toUserOpenId string, content string, toWxName ...string) (msgId int, err error)
预览文字消息
func (WxAccount) PreviewVideo ¶
func (w WxAccount) PreviewVideo(toUserOpenId string, mediaId string, toWxName ...string) (msgId int, err error)
预览视频消息
func (WxAccount) PreviewVoice ¶
func (w WxAccount) PreviewVoice(toUserOpenId string, mediaId string, toWxName ...string) (msgId int, err error)
预览语音消息
func (WxAccount) RecommendComment ¶
将评论标记为精选
func (WxAccount) RefreshUserAccessToken ¶
刷新accesstoken
func (WxAccount) ReplyComment ¶
回复评论
func (WxAccount) Semantic ¶
func (w WxAccount) Semantic(queryData map[string]interface{}, openId string) (map[string]interface{}, error)
* 语言理解
func (WxAccount) SendCardByOpenId ¶
根据openid群发卡券消息
func (WxAccount) SendCardByTag ¶
根据标签群发卡券消息
func (WxAccount) SendCustomerSupportMsg ¶
func (w WxAccount) SendCustomerSupportMsg(msg customerSupport.WxCustomerSupportMsg) error
发送消息
func (WxAccount) SendImageByOpenId ¶
func (w WxAccount) SendImageByOpenId(toUserOpenIds []string, mediaIds []string, recommend string, needOpenComment, onlyFansCanComment bool) (msgId int, err error)
根据openid群发图片消息
func (WxAccount) SendImageByTag ¶
func (w WxAccount) SendImageByTag(tagId int, mediaIds []string, recommend string, needOpenComment, onlyFansCanComment bool) (msgId int, err error)
根据标签群发图片消息
func (WxAccount) SendNewsByOpenId ¶
func (w WxAccount) SendNewsByOpenId(toUserOpenIds []string, mediaId string, sendIgnoreReprint bool) (msgId, msgDataId int, err error)
根据openid群发图文消息
func (WxAccount) SendNewsByTag ¶
func (w WxAccount) SendNewsByTag(tagId int, mediaId string, sendIgnoreReprint bool) (msgId, msgDataId int, err error)
根据标签群发图文消息
func (WxAccount) SendTemplateMsg ¶
func (w WxAccount) SendTemplateMsg(msg templateMsg.WxTemplateMsg) error
发送模版消息
func (WxAccount) SendTextByOpenId ¶
根据openid群发文字消息
func (WxAccount) SendTextByTag ¶
根据标签群发文字消息
func (WxAccount) SendVideoByOpenId ¶
根据openid群发视频消息
func (WxAccount) SendVideoByTag ¶
根据标签群发视频消息
func (WxAccount) SendVoiceByOpenId ¶
根据openid群发语音消息
func (WxAccount) SendVoiceByTag ¶
根据标签群发语音消息
func (*WxAccount) SetEventMsgHandleFunc ¶
func (w *WxAccount) SetEventMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
设置地理位置类型事件消息处理方法
func (*WxAccount) SetImageMsgHandleFunc ¶
func (w *WxAccount) SetImageMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
设置图片类型事件消息处理方法
func (*WxAccount) SetLocationMsgHandleFunc ¶
func (w *WxAccount) SetLocationMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
设置地理位置类型事件消息处理方法
func (*WxAccount) SetShortVideoMsgHandleFunc ¶
func (w *WxAccount) SetShortVideoMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
设置短视频类型事件消息处理方法
func (*WxAccount) SetTextMsgHandleFunc ¶
func (w *WxAccount) SetTextMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
设置文字类型事件消息处理方法
func (*WxAccount) SetVideoMsgHandleFunc ¶
func (w *WxAccount) SetVideoMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
设置视频类型事件消息处理方法
func (*WxAccount) SetVoiceMsgHandleFunc ¶
func (w *WxAccount) SetVoiceMsgHandleFunc(fn func(wxMsg *msg.WxMsg, xmlContent []byte) (*msg.WxRespMsg, error)) *WxAccount
设置声音类型事件消息处理方法
func (WxAccount) TagUserBatch ¶
批量为用户打标签
func (WxAccount) TicketToQrCodeImgByte ¶
func (WxAccount) TicketToQrCodeImgFile ¶
将ticket转化为img
func (WxAccount) UnRecommendComment ¶
取消评论精选
func (WxAccount) UnTagUserBatch ¶
批量为用户取消标签
func (WxAccount) UpdateCustomerSupport ¶
* 更新客服
func (WxAccount) UpdateNewsMaterial ¶
修改永久图文素材
func (WxAccount) UploadCustomerSupportAvatar ¶
* 上传客服头像
func (WxAccount) UploadNewsMaterialImg ¶
上传图文素材中的图片