spark-server/internal/module/conversation/model/conversation.go
2026-09-23 17:11:56 +08:00

16 lines
694 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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" }