package entity

import (
	"github.com/gocql/gocql"
)

// MessageDedup 對應 Cassandra 的 message_dedup 表
// Primary Key: ((room_id, uid), bucket_sec, content_md5)
// TTL: 2 秒
type MessageDedup struct {
	RoomID    gocql.UUID `db:"room_id" partition_key:"true"`
	UID       string     `db:"uid" partition_key:"true"`
	BucketSec int64      `db:"bucket_sec" clustering_key:"true"` // Unix timestamp in seconds
	ContentMD5 string     `db:"content_md5" clustering_key:"true"` // MD5 hash of content
}

// TableName 返回表名
func (m MessageDedup) TableName() string {
	return "message_dedup"
}

