企业微信客服开发的文档不太好理解 没找到 OpenKfId
mofadeyunduo opened this issue · 10 comments
https://powerwechat.artisan-cloud.com/zh/wecom/server.html#%E5%BC%80%E5%A7%8B%E6%8E%A5%E6%94%B6%E6%B6%88%E6%81%AF
在这里怎么接收客服消息呢
我查到了事件是 CALLBACK_EVENT_KF_MSG_OR_EVENT 没看到对应结构体 我尝试搜索结构体 不应该有 OpenKfId 字段么,参考这个文档 https://developer.work.weixin.qq.com/document/path/90238#12977,没搜到如何读取 OpenKfId
type RequestAccountServiceSendMsg struct {
ToUser string json:"touser"
OpenKfid string json:"open_kfid"
MsgID string json:"msgid"
MsgType string json:"msgtype"
Text RequestAccountServiceMsgText json:"text,omitempty"
Image RequestAccountServiceMsgImage json:"image,omitempty"
Voice RequestAccountServiceMsgVoice json:"voice,omitempty"
File RequestAccountServiceMsgFile json:"file,omitempty"
Link RequestAccountServiceMsgLink json:"link,omitempty"
MiniProgram RequestAccountServiceMsgMiniProgram json:"miniprogram,omitempty"
Menu RequestAccountServiceMsgMenu json:"msgmenu,omitempty"
Location RequestAccountServiceMsgLocation json:"location,omitempty"
}
这个发消息的对象是不是有点问题吧,应该是 *RequestAccountServiceMsgText,不然 omitempty 没用吧
type RequestAccountServiceSendMsg struct {
ToUser stringjson:"touser"
OpenKfid stringjson:"open_kfid"
MsgID stringjson:"msgid"
MsgType stringjson:"msgtype"
Text RequestAccountServiceMsgTextjson:"text,omitempty"
Image RequestAccountServiceMsgImagejson:"image,omitempty"
Voice RequestAccountServiceMsgVoicejson:"voice,omitempty"
File RequestAccountServiceMsgFilejson:"file,omitempty"
Link RequestAccountServiceMsgLinkjson:"link,omitempty"
MiniProgram RequestAccountServiceMsgMiniProgramjson:"miniprogram,omitempty"
Menu RequestAccountServiceMsgMenujson:"msgmenu,omitempty"
Location RequestAccountServiceMsgLocationjson:"location,omitempty"
}
这个发消息的对象是不是有点问题吧,应该是 *RequestAccountServiceMsgText,不然 omitempty 没用吧
你看到挺仔细,这个请查看最新的版本 : https://github.com/ArtisanCloud/PowerWeChat/tree/v3.1.13
已经追加了*
type RequestAccountServiceSendMsg struct {
ToUser stringjson:"touser"
OpenKfid stringjson:"open_kfid"
MsgID stringjson:"msgid"
MsgType stringjson:"msgtype"
Text RequestAccountServiceMsgTextjson:"text,omitempty"
Image RequestAccountServiceMsgImagejson:"image,omitempty"
Voice RequestAccountServiceMsgVoicejson:"voice,omitempty"
File RequestAccountServiceMsgFilejson:"file,omitempty"
Link RequestAccountServiceMsgLinkjson:"link,omitempty"
MiniProgram RequestAccountServiceMsgMiniProgramjson:"miniprogram,omitempty"
Menu RequestAccountServiceMsgMenujson:"msgmenu,omitempty"
Location RequestAccountServiceMsgLocationjson:"location,omitempty"
}
这个发消息的对象是不是有点问题吧,应该是 *RequestAccountServiceMsgText,不然 omitempty 没用吧你看到挺仔细,这个请查看最新的版本 : https://github.com/ArtisanCloud/PowerWeChat/tree/v3.1.13 已经追加了*
主要是我在开发企业微信客服...此外帮忙检查一下这些对象吧,很多都是 optional 的,比如 MsgID string json:"msgid"
,这个字段没加上 omitempty 传到微信会提示不合法的空字符串 msgid,必须要 omit 掉...
pls check v3.1.15
帮你添加了omit for
type RequestAccountServiceSendMsg struct {
ToUser string json:"touser"
OpenKfid string json:"open_kfid"
MsgID string json:"msgid,omitempty"
MsgType string json:"msgtype,omitempty"
Text *RequestAccountServiceMsgText json:"text,omitempty"
Image *RequestAccountServiceMsgImage json:"image,omitempty"
Voice *RequestAccountServiceMsgVoice json:"voice,omitempty"
File *RequestAccountServiceMsgFile json:"file,omitempty"
Link *RequestAccountServiceMsgLink json:"link,omitempty"
MiniProgram *RequestAccountServiceMsgMiniProgram json:"miniprogram,omitempty"
Menu *RequestAccountServiceMsgMenu json:"msgmenu,omitempty"
Location *RequestAccountServiceMsgLocation json:"location,omitempty"
}
thx 有空我就测一下 实在是太忙了
哦 抱歉 看到了 hashmap 结构你们过滤了
哦 抱歉 看到了 hashmap 结构你们过滤了
no problem