record

package
Version: 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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecordPageSizeLimit = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GetRecordRequest

type GetRecordRequest struct {
	StartTime int64  `json:"starttime"`        // 查询开始时间, UNIX时间戳
	EndTime   int64  `json:"endtime"`          // 查询结束时间, UNIX时间戳, 每次查询不能跨日查询
	PageIndex int    `json:"pageindex"`        // 查询第几页, 从1开始
	PageSize  int    `json:"pagesize"`         // 每页大小, 每页最多拉取50条
	OpenId    string `json:"openid,omitempty"` // 普通用户的标识, 对当前公众号唯一
}

type Record

type Record struct {
	Worker    string `json:"worker"`   // 客服账号
	OpenId    string `json:"openid"`   // 用户的标识, 对当前公众号唯一
	OperCode  int    `json:"opercode"` // 操作ID(会话状态)
	Timestamp int64  `json:"time"`     // 操作时间, UNIX时间戳
	Text      string `json:"text"`     // 聊天记录
}

func GetRecord

func GetRecord(clt *mp.Client, request *GetRecordRequest) (recordList []Record, err error)

获取客服聊天记录

type RecordIterator

type RecordIterator struct {
	// contains filtered or unexported fields
}

RecordIterator

iter, err := NewRecordIterator(clt, request)
if err != nil {
    // TODO: 增加你的代码
}

for iter.HasNext() {
    records, err := iter.NextPage()
    if err != nil {
        // TODO: 增加你的代码
    }
    // TODO: 增加你的代码
}

func NewRecordIterator

func NewRecordIterator(clt *mp.Client, request *GetRecordRequest) (iter *RecordIterator, err error)

获取聊天记录遍历器.

func (*RecordIterator) HasNext

func (iter *RecordIterator) HasNext() bool

func (*RecordIterator) NextPage

func (iter *RecordIterator) NextPage() (records []Record, err error)

Source Files

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