Documentation
¶
Index ¶
- type Account
- func (a *Account) Add(name, mediaId string) (string, error)
- func (a *Account) AddContactWay(openKfid, scene string) (string, error)
- func (a *Account) Delete(openKfid string) error
- func (a *Account) List(offset, limit int) (*AccountListResult, error)
- func (a *Account) Update(req UpdateAccountRequest) error
- type AccountInfo
- type AccountListResult
- type Kf
- type MediaContent
- type Message
- func (m *Message) SendImage(toUser, openKfid, mediaId string, msgid ...string) (string, error)
- func (m *Message) SendText(toUser, openKfid, content string, msgid ...string) (string, error)
- func (m *Message) SendVideo(toUser, openKfid, mediaId string, msgid ...string) (string, error)
- func (m *Message) SendVoice(toUser, openKfid, mediaId string, msgid ...string) (string, error)
- func (m *Message) SyncMsg(req SyncMsgRequest) (*SyncMsgResult, error)
- type MsgEventContent
- type ServiceState
- type ServiceStateInfo
- type ServiceStateTransRequest
- type Servicer
- type ServicerInfo
- type ServicerResult
- type SyncMsgItem
- type SyncMsgRequest
- type SyncMsgResult
- type TextContent
- type UpdateAccountRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account 客服账号管理
func NewAccount ¶
func NewAccount(account contracts.AccountInterface) *Account
func (*Account) AddContactWay ¶
AddContactWay 获取客服账号链接
type AccountInfo ¶
type AccountInfo struct {
OpenKfid string `json:"open_kfid"`
Name string `json:"name"`
Avatar string `json:"avatar"`
ManagePrivilege bool `json:"manage_privilege"`
}
AccountInfo 客服账号信息
type AccountListResult ¶
type AccountListResult struct {
AccountList []AccountInfo `json:"account_list"`
}
AccountListResult 获取客服账号列表结果
type Kf ¶
type Kf struct {
// contains filtered or unexported fields
}
Kf 微信客服
func NewKf ¶
func NewKf(account contracts.AccountInterface) *Kf
type MediaContent ¶
type MediaContent struct {
MediaId string `json:"media_id"`
}
MediaContent 媒体消息内容(图片/语音/视频)
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message 客服消息
func NewMessage ¶
func NewMessage(account contracts.AccountInterface) *Message
func (*Message) SyncMsg ¶
func (m *Message) SyncMsg(req SyncMsgRequest) (*SyncMsgResult, error)
SyncMsg 读取消息
type MsgEventContent ¶
type MsgEventContent struct {
EventType string `json:"event_type"`
OpenKfid string `json:"open_kfid"`
ExternalUserid string `json:"external_userid"`
Scene string `json:"scene,omitempty"`
SceneParam string `json:"scene_param,omitempty"`
WelcomeCode string `json:"welcome_code,omitempty"`
WechatChannels *struct {
Nickname string `json:"nickname,omitempty"`
} `json:"wechat_channels,omitempty"`
}
MsgEventContent 事件消息内容
type ServiceState ¶
type ServiceState struct {
// contains filtered or unexported fields
}
ServiceState 会话管理
func NewServiceState ¶
func NewServiceState(account contracts.AccountInterface) *ServiceState
func (*ServiceState) Get ¶
func (s *ServiceState) Get(openKfid, externalUserid string) (*ServiceStateInfo, error)
Get 获取会话状态
func (*ServiceState) Trans ¶
func (s *ServiceState) Trans(req ServiceStateTransRequest) (string, error)
Trans 变更会话状态
type ServiceStateInfo ¶
type ServiceStateInfo struct {
ServiceState int `json:"service_state"`
ServicerUserid string `json:"servicer_userid"`
}
ServiceStateInfo 会话状态信息
type ServiceStateTransRequest ¶
type ServiceStateTransRequest struct {
OpenKfid string `json:"open_kfid"`
ExternalUserid string `json:"external_userid"`
ServiceState int `json:"service_state"`
ServicerUserid string `json:"servicer_userid,omitempty"`
}
ServiceStateTransRequest 变更会话状态请求
type Servicer ¶
type Servicer struct {
// contains filtered or unexported fields
}
Servicer 接待人员管理
func NewServicer ¶
func NewServicer(account contracts.AccountInterface) *Servicer
func (*Servicer) Add ¶
func (s *Servicer) Add(openKfid string, useridList []string) ([]ServicerResult, error)
Add 添加接待人员
type ServicerInfo ¶
type ServicerInfo struct {
Userid string `json:"userid"`
Status int `json:"status"`
StopType int `json:"stop_type,omitempty"`
DepartmentId int `json:"department_id,omitempty"`
}
ServicerInfo 接待人员信息
type ServicerResult ¶
type ServicerResult struct {
Userid string `json:"userid"`
ErrCode int `json:"errcode"`
ErrMsg string `json:"errmsg"`
}
ServicerResult 添加/删除接待人员结果项
type SyncMsgItem ¶
type SyncMsgItem struct {
MsgId string `json:"msgid"`
OpenKfid string `json:"open_kfid"`
ExternalUserid string `json:"external_userid"`
SendTime int64 `json:"send_time"`
Origin int `json:"origin"`
ServicerUserid string `json:"servicer_userid"`
MsgType string `json:"msgtype"`
Text *TextContent `json:"text,omitempty"`
Image *MediaContent `json:"image,omitempty"`
Voice *MediaContent `json:"voice,omitempty"`
Video *MediaContent `json:"video,omitempty"`
Event *MsgEventContent `json:"event,omitempty"`
}
SyncMsgItem 消息项
type SyncMsgRequest ¶
type SyncMsgRequest struct {
Cursor string `json:"cursor,omitempty"`
Token string `json:"token,omitempty"`
Limit int `json:"limit,omitempty"`
VoiceFormat int `json:"voice_format,omitempty"`
OpenKfid string `json:"open_kfid,omitempty"`
}
SyncMsgRequest 读取消息请求
type SyncMsgResult ¶
type SyncMsgResult struct {
NextCursor string `json:"next_cursor"`
HasMore int `json:"has_more"`
MsgList []SyncMsgItem `json:"msg_list"`
}
SyncMsgResult 读取消息结果
type UpdateAccountRequest ¶
type UpdateAccountRequest struct {
OpenKfid string `json:"open_kfid"`
Name string `json:"name,omitempty"`
MediaId string `json:"media_id,omitempty"`
}
UpdateAccountRequest 修改客服账号请求
Click to show internal directories.
Click to hide internal directories.