Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2400 WxMaMessage 增加TemplateId、SubscribeStatusString等相关属性 #2477

Merged
merged 1 commit into from
Jan 3, 2022

Conversation

dany1
Copy link

@dany1 dany1 commented Dec 31, 2021

小程序端订阅消息之后,服务器会收到3种通知SubscribeMsgPopupEvent,SubscribeMsgChangeEvent,SubscribeMsgSentEvent,这三种通知是xml格式层级正常,如果是json格式的,三种类型的通知都叫做List,并且通知如果只有一条数据则List是对象,如果是多条数据List是数组
一条数据的时候是这样的
{ "ToUserName": "gh_123456789abc", "FromUserName": "o7esq5OI1Uej6Xixw1lA2H7XDVbc", "CreateTime": "1610968440", "MsgType": "event", "Event": "subscribe_msg_change_event", "List": { "TemplateId":"BEwX0BOT3MqK3Uc5oTU3CGBqzjpndk2jzUf7VfExd8", "SubscribeStatusString": "reject" } }
多条数据的时候是这样的
{ "ToUserName": "gh_123456789abc", "FromUserName": "o7esq5OI1Uej6Xixw1lA2H7XDVbc", "CreateTime": "1610968440", "MsgType": "event", "Event": "subscribe_msg_change_event", "List": [ { "TemplateId":"BEwX0BOT3MqK3Uc5oTU3CGBqzjpndk2jzUf7VfExd8", "SubscribeStatusString": "reject" },{ "TemplateId":"BEwX0BOT3MqK3Uc5oTU3CGBqzjpndk2jzUf7VfExd8", "SubscribeStatusString": "reject" }] }
在代码里面对这种情况做了兼容

@binarywang binarywang merged commit 76ea7fe into binarywang:develop Jan 3, 2022
@binarywang binarywang added this to the 4.2.4 milestone Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants