go-wxhelper/model/entity/message.go
2024-02-19 14:57:36 +08:00

27 lines
1.6 KiB
Go

package entity
import (
"time"
"wechat-robot/pkg/types"
)
// Message
// @description: 消息数据库结构体
type Message struct {
types.BaseDbModelWithReal
MsgId int64 `gorm:"index:idx_msg_id,unique;type:bigint;not null;comment:'微信Id'"` // 消息Id
Timestamp int `gorm:"type:bigint;not null;comment:'消息时间戳'"` // 发送时间戳
MessageTime time.Time `gorm:"type:datetime;not null;comment:'消息时间'"` // 发送时间
Type types.MessageType `gorm:"type:int;not null;comment:'消息类型'"` // 消息类型
Content string `gorm:"type:longtext;not null;comment:'消息内容'"` // 内容
DisplayFullContent string `gorm:"type:longtext;not null;comment:'显示的完整内容'"` // 显示的完整内容
FromUser string `gorm:"type:varchar(100);not null;comment:'发送者'"` // 发送者
GroupUser string `gorm:"type:varchar(100);comment:'群成员'"` // 群成员
ToUser string `gorm:"index:idx_msg_id,unique;type:varchar(100);not null;comment:'接收者'"` // 接收者
Raw string `gorm:"type:longtext;not null;comment:'原始通知字符串'"` // 原始通知字符串
}
func (Message) TableName() string {
return "t_message"
}