16 lines
694 B
Go
16 lines
694 B
Go
// Package model is conversation persistence. One file per table.
|
||
package model
|
||
|
||
import "time"
|
||
|
||
// Conversation maps table conversations.
|
||
type Conversation struct {
|
||
ID int64 `gorm:"column:id;primaryKey;comment:Snowflake 会话 id,时间有序主键"`
|
||
Type int `gorm:"column:type;comment:会话类型:1=单聊 2=群聊"`
|
||
LastMsgID int64 `gorm:"column:last_msg_id;comment:最新消息 Snowflake id,0 表示尚无消息"`
|
||
LastMsgAt time.Time `gorm:"column:last_msg_at;comment:最新消息时间(毫秒精度)"`
|
||
CreatedAt time.Time `gorm:"column:created_at;comment:会话创建时间"`
|
||
}
|
||
|
||
func (Conversation) TableName() string { return "t_conversations" }
|