Documentation ¶
Index ¶
- Constants
- func CreateMenu() (err error)
- func DeleteMenu() (err error)
- func SendMessageText(accessToken string, toUser, context string) (err error)
- type AppAccessTokenRsp
- type Message
- type MessageReply
- type MessageReplyText
- type MessageText
- type RefreshUserAccessTokenRsp
- type Response
- type UserInfoRsp
Constants ¶
View Source
const (
URLMessageSend = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token="
)
Variables ¶
This section is empty.
Functions ¶
func CreateMenu ¶
func CreateMenu() (err error)
func DeleteMenu ¶
func DeleteMenu() (err error)
func SendMessageText ¶
客服接口-发消息
Types ¶
type AppAccessTokenRsp ¶
type AppAccessTokenRsp struct { wx_open.WxResponse AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
func GetAppAccessToken ¶
func GetAppAccessToken(appid, appsecret string) (r *AppAccessTokenRsp, err error)
type MessageReply ¶
type MessageReply struct { XMLName xml.Name `xml:"xml"` ToUserName string `xml:"ToUserName"` FromUserName string `xml:"FromUserName"` CreateTime int64 `xml:"CreateTime"` MsgType string `xml:"MsgType"` // 消息类型 }
func (*MessageReply) Byte ¶
func (x *MessageReply) Byte() []byte
type MessageReplyText ¶
type MessageReplyText struct { MessageReply Content string `xml:"Content"` // 消息内容 }
func (*MessageReplyText) Byte ¶
func (x *MessageReplyText) Byte() []byte
type MessageText ¶
type RefreshUserAccessTokenRsp ¶
type RefreshUserAccessTokenRsp struct { wx_open.WxResponse RefreshToken string `json:"refresh_token"` Openid string `json:"openid"` Scope string `json:"scope"` AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
func RefreshUserAccessToken ¶
func RefreshUserAccessToken(appid, refreshToken string) (r *RefreshUserAccessTokenRsp, err error)
type UserInfoRsp ¶
type UserInfoRsp struct { wx_open.WxResponse SubscribeTime int64 `json:"subscribe_time"` //关注时间 Subscribe int `json:"subscribe"` //是否关注 OpenId string `json:"openid"` NickName string `json:"nickname"` Language string `json:"language"` Sex int `json:"sex"` Province string `json:"province"` City string `json:"city"` Remark string `json:"remark"` //备注 Country string `json:"country"` HeadImgURL string `json:"headimgurl"` UnionId string `json:"unionid"` GroupId int `json:"groupid"` TagIdList []int `json:"tagid_list"` }
func GetUserInfo ¶
func GetUserInfo(access_token, openid, lang string) (r *UserInfoRsp, err error)
授权之后获取用户信息,包含是否关注公众号, 注意这里的accessToken不是用户的token, 而是公众号的
Click to show internal directories.
Click to hide internal directories.