Files
wechat_ipad_pro/srv/wxtask/message_wrapper.go
2026-02-17 13:06:23 +08:00

21 lines
677 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package wxtask
import (
"xiawan/wx/protobuf/wechat"
)
// MessageWrapper 消息包装结构体用于WebSocket和callback消息同步时包含UUID信息
type MessageWrapper struct {
Key string `json:"key"` // UUID标识用于区分是哪个微信收到的消息
Message *wechat.AddMsg `json:"message"` // 原始消息内容
Type string `json:"type"` // 消息类型,如"message"、"contact_sync"等
}
// NewMessageWrapper 创建新的消息包装器
func NewMessageWrapper(key string, message *wechat.AddMsg, msgType string) *MessageWrapper {
return &MessageWrapper{
Key: key,
Message: message,
Type: msgType,
}
}