We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
WeComApp.Server.Notify()接收企微审批状态变更回调消息解析出来的数据是空的 `rs, err := pwWechat.WeComApp.Server.Notify(c.Request, func(event contract.EventInterface) interface{} { fmt.Dump("event", event) // kernel.Encryptor(event) msg := models1.EventOpenApprovalChange{} err := event.ReadMessage(&msg) if err != nil { println(err.Error()) return "error" } fmt.Dump(msg) return kernel.SUCCESS_EMPTY_RESPONSE
})`
{ "EventInterface": null, "XMLName": { "Space": "", "Local": "" }, "Text": "", "ToUserName": "ww674ab0ba94f03533", "FromUserName": "sys", "CreateTime": "1659066539", "MsgType": "event", "Event": "sys_approval_change", "ChangeType": "", "Content": null, "AgentID": "3010040", "ApprovalInfo": { "Text": "", "ThirdNo": "", "OpenSpName": "", "OpenTemplateID": "", "OpenSpStatus": "", "ApplyTime": "1658900033", "ApplyUserName": "", "ApplyUserID": "", "ApplyUserParty": "", "ApplyUserImage": "", "ApprovalNodes": { "Text": "", "ApprovalNode": { "Text": "", "NodeStatus": "", "NodeAttr": "", "NodeType": "", "Items": { "Text": "", "Item": { "Text": "", "ItemName": "", "ItemUserID": "", "ItemImage": "", "ItemStatus": "", "ItemSpeech": "", "ItemOpTime": "" } } } }, "NotifyNodes": { "Text": "", "NotifyNode": { "Text": "", "ItemName": "", "ItemUserID": "", "ItemImage": "" } }, "Approverstep": "" } }
The text was updated successfully, but these errors were encountered:
@Biely
初步来看, 是因为两边Go models结构体和微信发送过来的消息不一致导致的。
Go 结构体:
PowerWeChat/src/work/server/handlers/models/event.go
Line 171 in b399f0a
微信链接: https://developer.work.weixin.qq.com/document/path/91815
如果您这边急需,可以根据微信的xml消息结构体重新定义一个type EventOpenApprovalChange struct{} 来 替换msg := models1.EventOpenApprovalChange{}。
type EventOpenApprovalChange struct{}
msg := models1.EventOpenApprovalChange{}
我们预计明天会把这个结构体更新。 因为微信那边经常变更字段导致golang的强类型结构体对不上,方便的话可以帮忙提个PR。
Sorry, something went wrong.
已在v2.0.1-beta37中修复,谢谢你的问题
https://github.com/ArtisanCloud/PowerWeChat/tree/v2.0.1-beta37
No branches or pull requests
WeComApp.Server.Notify()接收企微审批状态变更回调消息解析出来的数据是空的
`rs, err := pwWechat.WeComApp.Server.Notify(c.Request, func(event contract.EventInterface) interface{} {
fmt.Dump("event", event)
// kernel.Encryptor(event)
msg := models1.EventOpenApprovalChange{}
err := event.ReadMessage(&msg)
if err != nil {
println(err.Error())
return "error"
}
fmt.Dump(msg)
return kernel.SUCCESS_EMPTY_RESPONSE
{ "EventInterface": null, "XMLName": { "Space": "", "Local": "" }, "Text": "", "ToUserName": "ww674ab0ba94f03533", "FromUserName": "sys", "CreateTime": "1659066539", "MsgType": "event", "Event": "sys_approval_change", "ChangeType": "", "Content": null, "AgentID": "3010040", "ApprovalInfo": { "Text": "", "ThirdNo": "", "OpenSpName": "", "OpenTemplateID": "", "OpenSpStatus": "", "ApplyTime": "1658900033", "ApplyUserName": "", "ApplyUserID": "", "ApplyUserParty": "", "ApplyUserImage": "", "ApprovalNodes": { "Text": "", "ApprovalNode": { "Text": "", "NodeStatus": "", "NodeAttr": "", "NodeType": "", "Items": { "Text": "", "Item": { "Text": "", "ItemName": "", "ItemUserID": "", "ItemImage": "", "ItemStatus": "", "ItemSpeech": "", "ItemOpTime": "" } } } }, "NotifyNodes": { "Text": "", "NotifyNode": { "Text": "", "ItemName": "", "ItemUserID": "", "ItemImage": "" } }, "Approverstep": "" } }
The text was updated successfully, but these errors were encountered: