mp

package
Version: v0.0.0-...-3b54ddd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

mp

Documentation

Index

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

func SendMessageText(accessToken string, toUser, context string) (err error)

客服接口-发消息

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 Message

type Message struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
}

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 MessageText struct {
	Message
	Text struct {
		Content string `json:"content"`
	} `json:"text"`
}

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 Response

type Response struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

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, 而是公众号的

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL