session

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

多客服会话控制

Documentation

Overview

多客服会话控制

Index

Constants

View Source
const (
	EventTypeKfCreateSession core.EventType = "kf_create_session" // 接入会话
	EventTypeKfCloseSession  core.EventType = "kf_close_session"  // 关闭会话
	EventTypeKfSwitchSession core.EventType = "kf_switch_session" // 转接会话
)

Variables

This section is empty.

Functions

func Close

func Close(clt *core.Client, openId, kfAccount, text string) (err error)

Close 关闭会话.

openId:    必须, 客户openid
kfAccount: 必须, 完整客服账号,格式为:账号前缀@公众号微信号
text:      可选, 附加信息,文本会展示在客服人员的多客服客户端

func Create

func Create(clt *core.Client, openId, kfAccount, text string) (err error)

Create 创建会话.

openId:    必须, 客户openid
kfAccount: 必须, 完整客服账号,格式为:账号前缀@公众号微信号
text:      可选, 附加信息,文本会展示在客服人员的多客服客户端

Types

type KfCloseSessionEvent

type KfCloseSessionEvent struct {
	XMLName struct{} `xml:"xml" json:"-"`
	core.MsgHeader
	EventType core.EventType `xml:"Event"     json:"Event"`
	KfAccount string         `xml:"KfAccount" json:"KfAccount"`
}

func GetKfCloseSessionEvent

func GetKfCloseSessionEvent(msg *core.MixedMsg) *KfCloseSessionEvent

type KfCreateSessionEvent

type KfCreateSessionEvent struct {
	XMLName struct{} `xml:"xml" json:"-"`
	core.MsgHeader
	EventType core.EventType `xml:"Event"     json:"Event"`
	KfAccount string         `xml:"KfAccount" json:"KfAccount"`
}

func GetKfCreateSessionEvent

func GetKfCreateSessionEvent(msg *core.MixedMsg) *KfCreateSessionEvent

type KfSwitchSessionEvent

type KfSwitchSessionEvent struct {
	XMLName struct{} `xml:"xml" json:"-"`
	core.MsgHeader
	EventType     core.EventType `xml:"Event"         json:"Event"`
	FromKfAccount string         `xml:"FromKfAccount" json:"FromKfAccount"`
	ToKfAccount   string         `xml:"ToKfAccount"   json:"ToKfAccount"`
}

func GetKfSwitchSessionEvent

func GetKfSwitchSessionEvent(msg *core.MixedMsg) *KfSwitchSessionEvent

type Session

type Session struct {
	OpenId     string `json:"openid"`     // 客户openid
	KfAccount  string `json:"kf_account"` // 正在接待的客服,为空表示没有人在接待
	CreateTime int64  `json:"createtime"` // 会话接入的时间
}

func Get

func Get(clt *core.Client, openId string) (ss *Session, err error)

Get 获取客户的会话

func List

func List(clt *core.Client, kfAccount string) (list []Session, err error)

List 获取客服的会话列表, 开发者可以通过本接口获取某个客服正在接待的会话列表.

type WaitCaseListResult

type WaitCaseListResult struct {
	TotalCount int       `json:"count"`                  // 未接入会话数量
	ItemCount  int       `json:"item_count"`             // 本次返回的未接入会话列表数量
	Items      []Session `json:"waitcaselist,omitempty"` // 本次返回的未接入会话列表
}

func WaitCaseList

func WaitCaseList(clt *core.Client) (rslt *WaitCaseListResult, err error)

WaitCaseList 获取未接入会话列表.

Jump to

Keyboard shortcuts

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