mass

package
v0.0.0-...-5652a87 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

群发消息.

Index

Constants

View Source
const (
	EventTypeMassSendJobFinish = "MASSSENDJOBFINISH"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client mp.Client

func NewClient

func NewClient(srv mp.AccessTokenServer, clt *http.Client) *Client

func (*Client) DeleteMass

func (clt *Client) DeleteMass(msgid int64) (err error)

删除群发.

func (*Client) GetMassStatus

func (clt *Client) GetMassStatus(msgid int64) (status *MassStatus, err error)

查询群发消息发送状态

func (*Client) MassToAll

func (clt *Client) MassToAll(msg interface{}) (rslt *MassResult, err error)

群发消息给所有用户

func (*Client) MassToGroup

func (clt *Client) MassToGroup(msg interface{}) (rslt *MassResult, err error)

群发消息给指定分组

func (*Client) MassToUsers

func (clt *Client) MassToUsers(msg interface{}) (rslt *MassResult, err error)

群发消息给指定用户列表

func (*Client) Preview

func (clt *Client) Preview(msg interface{}) (err error)

预览消息

type MassResult

type MassResult struct {
	MsgId int64 `json:"msg_id"` // 消息发送任务的ID

	// 消息的数据ID,,该字段只有在群发图文消息时,才会出现。可以用于在图文分析数据接口中,获取到对应的图文消息的数据,
	// 是图文分析数据接口中的msgid字段中的前半部分,详见图文分析数据接口中的msgid字段的介绍。
	MsgDataId int64 `json:"msg_data_id"`
}

type MassSendJobFinishEvent

type MassSendJobFinishEvent struct {
	XMLName struct{} `xml:"xml" json:"-"`
	mp.MessageHeader

	Event string `xml:"Event" json:"Event"` // 事件信息, 此处为 MASSSENDJOBFINISH

	MsgId int64 `xml:"MsgId" json:"MsgId"` // 群发的消息ID, 64位整型

	// 群发的结构, 为 "send success" 或 "send fail" 或 "err(num)".
	// 但 send success 时, 也有可能因用户拒收公众号的消息, 系统错误等原因造成少量用户接收失败.
	// err(num) 是审核失败的具体原因, 可能的情况如下:
	// err(10001), //涉嫌广告
	// err(20001), //涉嫌政治
	// err(20004), //涉嫌社会
	// err(20002), //涉嫌色情
	// err(20006), //涉嫌违法犯罪
	// err(20008), //涉嫌欺诈
	// err(20013), //涉嫌版权
	// err(22000), //涉嫌互推(互相宣传)
	// err(21000), //涉嫌其他
	Status string `xml:"Status" json:"Status"`

	TotalCount int `xml:"TotalCount" json:"TotalCount"` // group_id 下粉丝数, 或者 openid_list 中的粉丝数

	// 过滤(过滤是指特定地区, 性别的过滤, 用户设置拒收的过滤; 用户接收已超4条的过滤)后,
	// 准备发送的粉丝数, 原则上, FilterCount = SentCount + ErrorCount
	FilterCount int `xml:"FilterCount" json:"FilterCount"`
	SentCount   int `xml:"SentCount"   json:"SentCount"`  // 发送成功的粉丝数
	ErrorCount  int `xml:"ErrorCount"  json:"ErrorCount"` // 发送失败的粉丝数
}

高级群发消息, 事件推送群发结果

func GetMassSendJobFinishEvent

func GetMassSendJobFinishEvent(msg *mp.MixedMessage) *MassSendJobFinishEvent

type MassStatus

type MassStatus struct {
	MsgId  int64  `json:"msg_id"`
	Status string `json:"msg_status"` // 消息发送后的状态, SEND_SUCCESS表示发送成功
}

Directories

Path Synopsis
群发给所有用户的消息数据结构.
群发给所有用户的消息数据结构.
群发给分组的消息数据结构.
群发给分组的消息数据结构.
群发给用户列表的消息数据结构.
群发给用户列表的消息数据结构.
预览接口的消息数据结构.
预览接口的消息数据结构.

Jump to

Keyboard shortcuts

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