21 lines
702 B
Go
21 lines
702 B
Go
|
|
package db
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"xiawan/wx/protobuf/wechat"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// CallbackMessageWrapper callback消息包装结构体,用于包含UUID信息
|
|||
|
|
type CallbackMessageWrapper struct {
|
|||
|
|
Key string `json:"key"` // UUID标识,用于区分是哪个微信收到的消息
|
|||
|
|
Message *wechat.AddMsg `json:"message"` // 原始消息内容
|
|||
|
|
Type string `json:"type"` // 消息类型,如"message"、"contact_sync"等
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// NewCallbackMessageWrapper 创建新的callback消息包装器
|
|||
|
|
func NewCallbackMessageWrapper(key string, message *wechat.AddMsg, msgType string) *CallbackMessageWrapper {
|
|||
|
|
return &CallbackMessageWrapper{
|
|||
|
|
Key: key,
|
|||
|
|
Message: message,
|
|||
|
|
Type: msgType,
|
|||
|
|
}
|
|||
|
|
}
|