推送消息那里设置的JSON就要返回JOSN格式的,设置的XML就要返回XML格式的 [代码]KfMessage kfMessage = [代码][代码]new[代码] [代码]KfMessage();[代码][代码]kfMessage.setToUserName(messageJson.getString([代码][代码]"FromUserName"[代码][代码]));[代码][代码]kfMessage.setFromUserName(messageJson.getString([代码][代码]"ToUserName"[代码][代码]));[代码][代码]kfMessage.setCreateTime(messageJson.getLong([代码][代码]"CreateTime"[代码][代码]));[代码][代码]kfMessage.setMsgType([代码][代码]"transfer_customer_service"[代码][代码]);[代码] [代码]public[代码] [代码]class[代码] [代码]KfMessage {[代码][代码] [代码][代码]@JsonProperty[代码][代码]([代码][代码]"ToUserName"[代码][代码])[代码][代码] [代码][代码]private[代码] [代码]String toUserName;[代码][代码] [代码][代码]@JsonProperty[代码][代码]([代码][代码]"FromUserName"[代码][代码])[代码][代码] [代码][代码]private[代码] [代码]String fromUserName;[代码][代码] [代码][代码]@JsonProperty[代码][代码]([代码][代码]"CreateTime"[代码][代码])[代码][代码] [代码][代码]private[代码] [代码]long[代码] [代码]createTime;[代码][代码] [代码][代码]@JsonProperty[代码][代码]([代码][代码]"MsgType"[代码][代码])[代码][代码] [代码][代码]private[代码] [代码]String msgType;[代码] [代码] [代码][代码]public[代码] [代码]String getToUserName() {[代码][代码] [代码][代码]return[代码] [代码]toUserName;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]public[代码] [代码]void[代码] [代码]setToUserName(String toUserName) {[代码][代码] [代码][代码]this[代码][代码].toUserName = toUserName;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]public[代码] [代码]String getFromUserName() {[代码][代码] [代码][代码]return[代码] [代码]fromUserName;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]public[代码] [代码]void[代码] [代码]setFromUserName(String fromUserName) {[代码][代码] [代码][代码]this[代码][代码].fromUserName = fromUserName;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]public[代码] [代码]long[代码] [代码]getCreateTime() {[代码][代码] [代码][代码]return[代码] [代码]createTime;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]public[代码] [代码]void[代码] [代码]setCreateTime([代码][代码]long[代码] [代码]createTime) {[代码][代码] [代码][代码]this[代码][代码].createTime = createTime;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]public[代码] [代码]String getMsgType() {[代码][代码] [代码][代码]return[代码] [代码]msgType;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]public[代码] [代码]void[代码] [代码]setMsgType(String msgType) {[代码][代码] [代码][代码]this[代码][代码].msgType = msgType;[代码][代码] [代码][代码]}[代码][代码]}[代码][代码] [代码][代码]kfMessage.setCreateTime(messageJson.getLong([代码][代码]"CreateTime"[代码][代码]));[代码][代码] [代码][代码]kfMessage.setMsgType([代码][代码]"transfer_customer_service"[代码][代码]);[代码]然后controller返回kfMessage就好了
客服消息转发到网页版客服工具没反应开发者只在响应包中返回 MsgType 为 transfer_customer_service 的消息,微信服务器收到响应后就会把当次发送的消息转发至客服系统。 {"ToUserName":"o4SqQ4gknu57-Za3uxN_noUi5Yl4","FromUserName":"打码","CreateTime":1554974253,"MsgType":"transfer_customer_service"} 设置了这个还是不行
2019-08-21