mp

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CDATA

type CDATA struct {
	Text string `xml:",cdata"`
}

type Code

type Code struct {
	ExpireSeconds int    `json:"expire_seconds,omitempty"`
	ActionName    string `json:"action_name"`
	ActionInfo    struct {
		Scene struct {
			SceneID  int    `json:"scene_id,omitempty"`
			SceneStr string `json:"scene_str,omitempty"`
		} `json:"scene"`
	} `json:"action_info"`
}

type CodeResponse

type CodeResponse struct {
	Ticket        string `json:"ticket"`
	ExpireSeconds int    `json:"expire_seconds"`
	URL           string `json:"url"`
}

type Comment

type Comment struct {
	MsgDataID int `json:"msg_data_id"`
	Index     int `json:"index"`
	Begin     int `json:"begin"`
	Count     int `json:"count"`
	Type      int `json:"type"`
}

type DelPush

type DelPush struct {
	MsgID      int `json:"msg_id"`
	ArticleIdx int `json:"article_idx"`
}

type Mp

type Mp struct {
	Appid       string
	Secret      string
	Token       *utils.Token
	Oauth2Token *OauthToken
	Hook        utils.Hook
}

func New

func New(appid, secret string, Hook ...utils.Hook) *Mp

*

  • @param
  • @author struggler
  • @description 初始化wechatmp
  • @date 10:36 上午 2021/2/24
  • @return *

func (*Mp) CallbackIp

func (m *Mp) CallbackIp() (interface{}, error)

获取微信服务器ip

func (*Mp) CancelTagsUser

func (m *Mp) CancelTagsUser(body []byte) (interface{}, error)

批量为用户取消标签 { "openid_list" : [//粉丝列表 "ocYxcuAEy30bX0NXmGn4ypqx3tI0", "ocYxcuBt0mRugKZ7tGAHPnUaOW7Y" ], "tagid" : 134 }

func (*Mp) CheckImg

func (m *Mp) CheckImg(file io.Reader, fileName string) (interface{}, error)

func (*Mp) CheckText

func (m *Mp) CheckText(body []byte) (interface{}, error)

内容安全检查

func (*Mp) CreateForeverAcode

func (m *Mp) CreateForeverAcode(actionName, scene string) (interface{}, error)

创建永久二维码 QR_LIMIT_SCENE QR_LIMIT_STR_SCENE

func (*Mp) CreateMoreAcode

func (m *Mp) CreateMoreAcode(actionName, scene string) (interface{}, error)

创建临时二维码 QR_SCENE QR_STR_SCENE

func (*Mp) CreateNews

func (m *Mp) CreateNews(news News) int64

上传图文素材

{
	"articles": [
	{
		"thumb_media_id":"qI6_Ze_6PtV7svjolgs-rN6stStuHIjs9_DidOHaj0Q-mwvBelOXCFZiq2OsIU-p",
		"author":"xxx",
		"title":"Happy Day",
		"content_source_url":"www.qq.com",
		"content":"content",
		"digest":"digest",
		"show_cover_pic":1,
		"need_open_comment":1,
		"only_fans_can_comment":1
	},
	{
		"thumb_media_id":"qI6_Ze_6PtV7svjolgs-rN6stStuHIjs9_DidOHaj0Q-mwvBelOXCFZiq2OsIU-p",
		"author":"xxx",
		"title":"Happy Day",
		"content_source_url":"www.qq.com",
		"content":"content",
		"digest":"digest",
		"show_cover_pic":0,
		"need_open_comment":1,
		"only_fans_can_comment":1
	}

] }

func (*Mp) DelForeverMedia

func (m *Mp) DelForeverMedia(body []byte) (interface{}, error)

删除永久素材

{
	"media_id" : "media id"
}

func (*Mp) DelStyleMenu

func (m *Mp) DelStyleMenu(body []byte) (interface{}, error)

删除个性化菜单

func (*Mp) DelTemplateId

func (m *Mp) DelTemplateId(body []byte) (interface{}, error)

删除模版

{
	"template_id" : "Dyvp3-Ff0cnail_CDSzk1fIc6-9lOkxsQE7exTJbwUE"
}

func (*Mp) Get added in v1.1.6

func (a *Mp) Get(path string, params utils.Query, withAccessToken ...bool) ([]byte, error)

Get

func (*Mp) GetAccessToken

func (m *Mp) GetAccessToken(reflush ...bool) *utils.Token

获取accessToken

func (*Mp) GetAccessTokenWithHook added in v1.1.3

func (m *Mp) GetAccessTokenWithHook(reflush ...bool) *utils.Token

获取accessToken

func (*Mp) GetCommentList

func (m *Mp) GetCommentList(msgDataId, index, begin, count, type_ int) (interface{}, error)

获取文章评论

func (*Mp) GetConfig added in v1.1.0

func (m *Mp) GetConfig() utils.Config

func (*Mp) GetForeverMedia

func (m *Mp) GetForeverMedia(mediaId string) ([]byte, error)

获取永久素材 type :媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb)

func (*Mp) GetForeverMediaCount

func (m *Mp) GetForeverMediaCount() ([]byte, error)

获取永久素材总数

func (*Mp) GetForeverMediaList

func (m *Mp) GetForeverMediaList(body []byte) (interface{}, error)

获取永久素材列表

{
	"type":TYPE,
	"offset":OFFSET,
	"count":COUNT
}

func (*Mp) GetIndustry

func (m *Mp) GetIndustry() (interface{}, error)

获取设置的行业信息

func (*Mp) GetMenu

func (m *Mp) GetMenu() (interface{}, error)

获取全部菜单(包括个性菜单)

func (*Mp) GetOauthAccessToken

func (m *Mp) GetOauthAccessToken(code string) *OauthToken

GetOauthAccessToken 获取Oauth2accessToken(网页版本) //不可以缓存,每个用户的登陆凭证不一样

func (*Mp) GetOauthUserInfo

func (m *Mp) GetOauthUserInfo(token, openid string) (string, error)

GetOauthUserInfo 获取oauth用户真实信息

func (*Mp) GetReplyRules

func (m *Mp) GetReplyRules() (interface{}, error)

获取回复规则

func (*Mp) GetSelfMenu

func (m *Mp) GetSelfMenu() (interface{}, error)

获取普通菜单

func (*Mp) GetShortUrl

func (m *Mp) GetShortUrl(longUrl string) (string, error)

长链接转短链接 w.url.cn

func (*Mp) GetTags

func (m *Mp) GetTags() (interface{}, error)

获取所有tag

func (*Mp) GetTagsOneUser

func (m *Mp) GetTagsOneUser(body []byte) (interface{}, error)

获取用户身上的标签 { "openid" : "ocYxcuBt0mRugKZ7tGAHPnUaOW7Y" }

func (*Mp) GetTagsUser

func (m *Mp) GetTagsUser(body []byte) (UserListResponse, error)

获取标签下粉丝列表 { "tagid" : 134, "next_openid":""//第一个拉取的OPENID,不填默认从头开始拉取 }

func (*Mp) GetTempMedia

func (m *Mp) GetTempMedia(mediaId string) ([]byte, error)

获取临时素材 type :媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb)

func (*Mp) GetTemplateId

func (m *Mp) GetTemplateId(body []byte) (interface{}, error)

获得模板ID { "template_id_short":"TM00015" }

func (*Mp) GetTemplateList

func (m *Mp) GetTemplateList() (interface{}, error)

获取模板列表

func (*Mp) GetTicketAcode

func (m *Mp) GetTicketAcode(ticket string) (interface{}, error)

通过ticket换取真的二维码

func (*Mp) GetUserDetail

func (m *Mp) GetUserDetail(openId string) (string, error)

获取用户详细信息(unionid)

func (*Mp) GetUserList

func (m *Mp) GetUserList(nextOpenId string) (UserListResponse, error)

获取用户列表

func (*Mp) GetUsersDetail

func (m *Mp) GetUsersDetail(body []byte) (interface{}, error)

批量获取用户详细信息

{
	"user_list": [
		{
		"openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
		"lang": "zh_CN"
		},
		{
		"openid": "otvxTs_JZ6SEiP0imdhpi50fuSZg",
		"lang": "zh_CN"
		}
	]
}

func (*Mp) InsertTags

func (m *Mp) InsertTags(body []byte) (interface{}, error)

用户标签管理 增加tag { "tag" : { "name" : "广东"//标签名 } }

func (*Mp) PostBody added in v1.1.6

func (a *Mp) PostBody(path string, body []byte, withAccessToken ...bool) ([]byte, error)

Post

func (*Mp) PushDel

func (m *Mp) PushDel(msgId, articleIdx int) int64

删除群发

func (*Mp) PushServerImage

func (m *Mp) PushServerImage(news ServerSendImage) int64

func (*Mp) PushServerNews

func (m *Mp) PushServerNews(news ServerSendNews) int64

func (*Mp) PushServerText

func (m *Mp) PushServerText(news ServerSendText) int64

func (*Mp) PushServerVoice

func (m *Mp) PushServerVoice(news ServerSendVoice) int64

func (*Mp) PushSubscribeTemplate

func (m *Mp) PushSubscribeTemplate(body []byte) (interface{}, error)

发送订阅消息

 {
    "touser":"OPENID",
    "template_id":"TEMPLATE_ID",
    "url":"URL",
    "miniprogram":{
    "appid":"xiaochengxuappid12345",
    "pagepath":"index?foo=bar"
},
    "scene":"SCENE",
    "title":"TITLE",
    "data":{
    "content":{
    "value":"VALUE",
    "color":"COLOR"
}

} }

func (*Mp) PushTemplate

func (m *Mp) PushTemplate(body []byte) (interface{}, error)

发送模版信息

{
          "touser":"OPENID",
          "template_id":"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY",
          "url":"http://weixin.qq.com/download",
          "miniprogram":{
            "appid":"xiaochengxuappid12345",
            "pagepath":"index?foo=bar"
          },
          "data":{
                  "first": {
                      "value":"恭喜你购买成功!",
                      "color":"#173177"
                  },
                  "keyword1":{
                      "value":"巧克力",
                      "color":"#173177"
                  },
                  "keyword2": {
                      "value":"39.8元",
                      "color":"#173177"
                  },
                  "keyword3": {
                      "value":"2014年9月22日",
                      "color":"#173177"
                  },
                  "remark":{
                      "value":"欢迎再次购买!",
                      "color":"#173177"
                  }
          }
      }

func (*Mp) RefreshOauthAccessToken

func (m *Mp) RefreshOauthAccessToken(refreshToken string) (interface{}, error)

RefreshOauthAccessToken 刷新Oauth2accessToken

func (*Mp) RemoveMenu

func (m *Mp) RemoveMenu() (interface{}, error)

删除菜单

func (*Mp) RemoveTags

func (m *Mp) RemoveTags(body []byte) (interface{}, error)

删除tag { "tag":{ "id" : 134 } }

func (*Mp) SendCommandMsg

func (m *Mp) SendCommandMsg(openid, command string) int64

客服发送状态 command[ Typing CancelTyping ]

func (*Mp) SendImageMsg

func (m *Mp) SendImageMsg(mediaId, openid string) int64

发送图片

func (*Mp) SendMiniProgramMsg

func (m *Mp) SendMiniProgramMsg(openid, thumbMediaId, pagepath, appid, title string) int64

发送小程序

func (*Mp) SendMpnewsMsg

func (m *Mp) SendMpnewsMsg(openid, mediaid string) int64

发送素材信息

func (*Mp) SendMusicMsg

func (m *Mp) SendMusicMsg(openid, thumbMediaId, musicurl, hqmusicurl, title, description string) int64

发送音乐

func (*Mp) SendNewsMsg

func (m *Mp) SendNewsMsg(openid, title, description, url_, picurl string) int64

发送外链图文信息

func (*Mp) SendPreviewImageMsg

func (m *Mp) SendPreviewImageMsg(mediaId, openid string) int64

发送图片

func (*Mp) SendPreviewTextMsg

func (m *Mp) SendPreviewTextMsg(content, openid string) int64

发送文本消息

func (*Mp) SendTextMsg

func (m *Mp) SendTextMsg(content, openid string) int64

发送文本消息

func (*Mp) SendVideoMsg

func (m *Mp) SendVideoMsg(mediaId, openid, thumbMediaId, title, description string) int64

发送视频

func (*Mp) SendVoiceMsg

func (m *Mp) SendVoiceMsg(mediaId, openid string) int64

发送声音

func (*Mp) Session

func (m *Mp) Session(code string) (User, error)

获取session

func (*Mp) SetForeverNews

func (m *Mp) SetForeverNews(body []byte) (interface{}, error)

新增永久素材

func (*Mp) SetIndustry

func (m *Mp) SetIndustry(body []byte) (interface{}, error)

设置行业信息 { "industry_id1":"1", "industry_id2":"4" }

func (*Mp) SetMenu

func (m *Mp) SetMenu(body []byte) (interface{}, error)

设置菜单

func (*Mp) SetStyleMenu

func (m *Mp) SetStyleMenu(body []byte) (interface{}, error)

设置个性化菜单

func (*Mp) SetTagsUser

func (m *Mp) SetTagsUser(body []byte) (interface{}, error)

批量为用户打标签

{
   "openid_list" : [//粉丝列表
   "ocYxcuAEy30bX0NXmGn4ypqx3tI0",
   "ocYxcuBt0mRugKZ7tGAHPnUaOW7Y"   ],
   "tagid" : 134
}

func (*Mp) SetUserRemark

func (m *Mp) SetUserRemark(openId, remark string) (interface{}, error)

为用户备注

func (*Mp) TestStyleMenu

func (m *Mp) TestStyleMenu(body []byte) (interface{}, error)

测试个性化菜单

func (*Mp) UpdateTags

func (m *Mp) UpdateTags(body []byte) (interface{}, error)

修改tag { "tag" : { "id" : 134, "name" : "广东人" } }

func (*Mp) UploadForeverMedia

func (m *Mp) UploadForeverMedia(fileUrlPath, type_ string) (string, error)

上传永久素材 type :媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb)

func (*Mp) UploadImg

func (m *Mp) UploadImg(file io.Reader, fileName string) (interface{}, error)

上传图片

func (*Mp) UploadTempMedia

func (m *Mp) UploadTempMedia(fileUrlPath, type_ string) (string, error)

上传临时素材 type :媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb)

func (*Mp) UploadTempMediaBinary

func (m *Mp) UploadTempMediaBinary(file io.Reader, fileName string, type_ string) (interface{}, error)

上传临时素材Binary type :媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb)

func (*Mp) VerifyOauthToken

func (m *Mp) VerifyOauthToken(openid string) (interface{}, error)

VerifyOauthToken 验证Oauth2accessToken是否有效

type News

type News struct {
	Articles []struct {
		ThumbMediaID       string `json:"thumb_media_id"`
		Author             string `json:"author"`
		Title              string `json:"title"`
		ContentSourceURL   string `json:"content_source_url"`
		Content            string `json:"content"`
		Digest             string `json:"digest"`
		ShowCoverPic       int    `json:"show_cover_pic"`
		NeedOpenComment    int    `json:"need_open_comment"`
		OnlyFansCanComment int    `json:"only_fans_can_comment"`
	} `json:"articles"`
}

type OauthToken

type OauthToken struct {
	Token        string
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	OpenId       string `json:"openid"`
	Scope        string `json:"scope"`
	UpdateTime   int
}

type Remark

type Remark struct {
	Openid string `json:"openid"`
	Remark string `json:"remark"`
}

type SendArticle

type SendArticle struct {
	XMLName      xml.Name          `xml:"xml"`
	ToUserName   CDATA             `xml:"ToUserName"`
	FromUserName CDATA             `xml:"FromUserName"`
	CreateTime   int               `xml:"CreateTime"`
	MsgType      CDATA             `xml:"MsgType"`
	ArticleCount int               `xml:"ArticleCount"`
	Articles     []SendArticleItem `xml:"Articles>item"`
}

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[news]]></MsgType>
<ArticleCount>1</ArticleCount>
<Articles>
  <item>
    <Title><![CDATA[title1]]></Title>
    <Description><![CDATA[description1]]></Description>
    <PicUrl><![CDATA[picurl]]></PicUrl>
    <Url><![CDATA[url]]></Url>
  </item>
</Articles>

</xml>

type SendArticleItem

type SendArticleItem struct {
	XMLName     xml.Name `xml:"item"`
	Title       CDATA    `xml:"Title"`
	Description CDATA    `xml:"Description"`
	PicUrl      CDATA    `xml:"PicUrl"`
	Url         CDATA    `xml:"Url"`
}

type SendCommand

type SendCommand struct {
	Touser  string `json:"touser"`
	Command string `json:"command"`
}

SendCommand 客服状态

type SendJsonImage

type SendJsonImage struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
	Image   struct {
		MediaId string `json:"media_id"`
	} `json:"image"`
}

type SendJsonText

type SendJsonText struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
	Text    struct {
		Content string `json:"content"`
	} `json:"text"`
}

type SendJsonVideo

type SendJsonVideo struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
	Video   struct {
		MediaId      string `json:"media_id"`
		ThumbMediaId string `json:"thumb_media_id"`
		Title        string `json:"title"`
		Description  string `json:"description"`
	} `json:"video"`
}

type SendJsonVoice

type SendJsonVoice struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
	Voice   struct {
		MediaId string `json:"media_id"`
	} `json:"voice"`
}

type SendMini

type SendMini struct {
	Touser          string `json:"touser"`
	Msgtype         string `json:"msgtype"`
	Miniprogrampage struct {
		Title        string `json:"title"`
		Appid        string `json:"appid"`
		Pagepath     string `json:"pagepath"`
		ThumbMediaId string `json:"thumb_media_id"`
	} `json:"miniprogrampage"`
}

type SendMpNews

type SendMpNews struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
	Mpnews  struct {
		MediaId string `json:"media_id"`
	} `json:"mpnews"`
}

type SendMsgMenu

type SendMsgMenu struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
	Msgmenu struct {
		HeadContent string `json:"head_content"`
		List        []struct {
			ID      string `json:"id"`
			Content string `json:"content"`
		} `json:"list"`
		TailContent string `json:"tail_content"`
	} `json:"msgmenu"`
}

type SendMusic

type SendMusic struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
	Music   struct {
		Musicurl     string `json:"musicurl"`
		Hqmusicurl   string `json:"hqmusicurl"`
		ThumbMediaId string `json:"thumb_media_id"`
		Title        string `json:"title"`
		Description  string `json:"description"`
	} `json:"music"`
}

type SendNews

type SendNews struct {
	Touser  string `json:"touser"`
	Msgtype string `json:"msgtype"`
	News    struct {
		Articles []struct {
			Url         string `json:"url"`
			Picurl      string `json:"picurl"`
			Title       string `json:"title"`
			Description string `json:"description"`
		} `json:"articles"`
	} `json:"news"`
}

type SendXmlImage

type SendXmlImage struct {
	XMLName      xml.Name `xml:"xml"`
	ToUserName   CDATA    `xml:"ToUserName"`
	FromUserName CDATA    `xml:"FromUserName"`
	CreateTime   int      `xml:"CreateTime"`
	MsgType      CDATA    `xml:"MsgType"`
	Image        struct {
		MediaId CDATA `xml:"MediaId"`
	} `xml:"Image"`
}

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[image]]></MsgType>
<Image>
  <MediaId><![CDATA[media_id]]></MediaId>
</Image>

</xml>

type SendXmlText

type SendXmlText struct {
	XMLName      xml.Name `xml:"xml"`
	ToUserName   CDATA    `xml:"ToUserName"`
	FromUserName CDATA    `xml:"FromUserName"`
	CreateTime   int      `xml:"CreateTime"`
	MsgType      CDATA    `xml:"MsgType"`
	Content      CDATA    `xml:"Content"`
}

返回信息的结构体

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[你好]]></Content>

</xml>

type SendXmlVideo

type SendXmlVideo struct {
	XMLName      xml.Name `xml:"xml"`
	ToUserName   CDATA    `xml:"ToUserName"`
	FromUserName CDATA    `xml:"FromUserName"`
	CreateTime   int      `xml:"CreateTime"`
	MsgType      CDATA    `xml:"MsgType"`
	Video        struct {
		MediaId     CDATA `xml:"MediaId"`
		Title       CDATA `xml:"Title"`
		Description CDATA `xml:"Description"`
	} `xml:"Video"`
}

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[video]]></MsgType>
<Video>
  <MediaId><![CDATA[media_id]]></MediaId>
  <Title><![CDATA[title]]></Title>
  <Description><![CDATA[description]]></Description>
</Video>

</xml>

type SendXmlVoice

type SendXmlVoice struct {
	XMLName      xml.Name `xml:"xml"`
	ToUserName   CDATA    `xml:"ToUserName"`
	FromUserName CDATA    `xml:"FromUserName"`
	CreateTime   int      `xml:"CreateTime"`
	MsgType      CDATA    `xml:"MsgType"`
	Voice        struct {
		MediaId CDATA `xml:"MediaId"`
	} `xml:"Voice"`
}

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[voice]]></MsgType>
<Voice>
  <MediaId><![CDATA[media_id]]></MediaId>
</Voice>

</xml>

type ServerSendImage

type ServerSendImage struct {
	Touser []string `json:"touser"`
	Images struct {
		MediaIds           []string `json:"media_ids"`
		Recommend          string   `json:"recommend"`
		NeedOpenComment    int      `json:"need_open_comment"`
		OnlyFansCanComment int      `json:"only_fans_can_comment"`
	} `json:"images"`
	Msgtype string `json:"msgtype"`
}

type ServerSendNews

type ServerSendNews struct {
	Touser []string `json:"touser"`
	Mpnews struct {
		MediaID string `json:"media_id"`
	} `json:"mpnews"`
	Msgtype           string `json:"msgtype"`
	SendIgnoreReprint int    `json:"send_ignore_reprint"`
}

ServerSendNews 服务号结构体

type ServerSendText

type ServerSendText struct {
	Touser  []string `json:"touser"`
	Msgtype string   `json:"msgtype"`
	Text    struct {
		Content string `json:"content"`
	} `json:"text"`
}

type ServerSendVoice

type ServerSendVoice struct {
	Touser []string `json:"touser"`
	Voice  struct {
		MediaID string `json:"media_id"`
	} `json:"voice"`
	Msgtype string `json:"msgtype"`
}

type SessionResponse

type SessionResponse struct {
	Openid     string
	SessionKey string
	Unionid    string
	Errcode    int
	ErrMsg     string
}

type ShortUrl

type ShortUrl struct {
	Action  string `json:"action"`
	LongUrl string `json:"long_url"`
}

type Subscribe

type Subscribe struct {
	Touser     string      `json:"touser,omitempty"`
	TemplateId string      `json:"template_id,omitempty"`
	Page       string      `json:"page,omitempty"`
	Data       interface{} `json:"data,omitempty"`
}

type TagPushImage

type TagPushImage struct {
	Filter struct {
		IsToAll bool `json:"is_to_all"`
		TagID   int  `json:"tag_id"`
	} `json:"filter"`
	Images struct {
		MediaIds           []string `json:"media_ids"`
		Recommend          string   `json:"recommend"`
		NeedOpenComment    int      `json:"need_open_comment"`
		OnlyFansCanComment int      `json:"only_fans_can_comment"`
	} `json:"images"`
	Msgtype string `json:"msgtype"`
}

type TagPushNews

type TagPushNews struct {
	Filter struct {
		IsToAll bool `json:"is_to_all"`
		TagID   int  `json:"tag_id"`
	} `json:"filter"`
	Mpnews struct {
		MediaID string `json:"media_id"`
	} `json:"mpnews"`
	Msgtype           string `json:"msgtype"`
	SendIgnoreReprint int    `json:"send_ignore_reprint"`
}

type TagPushText

type TagPushText struct {
	Filter struct {
		IsToAll bool `json:"is_to_all"`
		TagID   int  `json:"tag_id"`
	} `json:"filter"`
	Text struct {
		Content string `json:"content"`
	} `json:"text"`
	Msgtype string `json:"msgtype"`
}

type TagPushVideo

type TagPushVideo struct {
	MediaID     string `json:"media_id"`
	Title       string `json:"title"`
	Description string `json:"description"`
}

type TagPushVoice

type TagPushVoice struct {
	Filter struct {
		IsToAll bool `json:"is_to_all"`
		TagID   int  `json:"tag_id"`
	} `json:"filter"`
	Voice struct {
		MediaID string `json:"media_id"`
	} `json:"voice"`
	Msgtype string `json:"msgtype"`
}

type Template

type Template struct {
	Touser     string      `json:"touser,omitempty"`
	TemplateId string      `json:"template_id,omitempty"`
	Page       string      `json:"page,omitempty"`
	Data       interface{} `json:"data,omitempty"`
}

type Text

type Text struct {
	Content string `json:"content"`
}

type TextResponse

type TextResponse struct {
	Errcode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

type User

type User struct {
	Session string `json:"session,omitempty"`
	Openid  string `json:"openid,omitempty"`
	Appid   string `json:"appid,omitempty"`
	Unionid string `json:"unionid,omitempty"`
	Status  bool   `json:"status,omitempty"`
}

type UserListResponse

type UserListResponse struct {
	Total int `json:"total"`
	Count int `json:"count"`
	Data  struct {
		Openid []string `json:"openid"`
	} `json:"data"`
	NextOpenid string `json:"next_openid"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL