李寻欢 b256d82855
All checks were successful
BuildImage / build-image (push) Successful in 7m30s
:feature: 添加WebSocket API以实时获取容器日志,并优化消息结构
2025-04-22 20:44:57 +08:00

41 lines
1.3 KiB
Go

package model
import (
"gitee.ltd/lxh/wechat-robot/internal/types"
"time"
)
// ContentType 表示消息类型的枚举
type ContentType string
const (
ContentTypeText ContentType = "text"
ContentTypeImage ContentType = "image"
ContentTypeVoice ContentType = "voice"
ContentTypeVideo ContentType = "video"
ContentTypeFile ContentType = "file"
ContentTypeLocation ContentType = "location"
ContentTypeSystem ContentType = "system"
)
// Message 表示微信消息
type Message struct {
BaseModel
RobotId uint `gorm:"index:deleted,unique"` // 机器人Id
MsgId int64 `gorm:"index:deleted,unique"` // 消息Id
ClientMsgId int `gorm:"index:deleted,unique"` // 客户端消息Id
CreateTime int // 发送时间戳
CreateAt time.Time // 发送时间
Type types.MessageType // 消息类型
Content string // 内容
DisplayFullContent string // 显示的完整内容
FromUser string // 发送者
GroupUser string // 群成员
ToUser string // 接收者
}
// TableName 指定表名
func (Message) TableName() string {
return "messages"
}