Initial backend repository commit.
Set up project files and add .gitignore to exclude local build/runtime artifacts. Made-with: Cursor
This commit is contained in:
19
internal/model/message_read.go
Normal file
19
internal/model/message_read.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// MessageRead 消息已读状态
|
||||
// 记录每个用户在每个会话中的已读位置
|
||||
type MessageRead struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
ConversationID int64 `gorm:"uniqueIndex:idx_conversation_user;not null" json:"conversation_id"`
|
||||
UserID uint `gorm:"uniqueIndex:idx_conversation_user;not null" json:"user_id"`
|
||||
LastReadSeq int64 `gorm:"not null" json:"last_read_seq"` // 已读到的seq位置
|
||||
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
|
||||
}
|
||||
|
||||
func (MessageRead) TableName() string {
|
||||
return "message_reads"
|
||||
}
|
||||
Reference in New Issue
Block a user