李寻欢 080fdb66ab
All checks were successful
BuildImage / build-image (push) Successful in 2m2s
🎨 添加定时任务调度,优化消息同步逻辑,更新相关API接口调用
2025-04-07 16:08:55 +08:00

40 lines
1.1 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 // 机器人Id
MsgId int64 // 消息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"
}