Files
platforms/backend/api/internal/models/user_message_read.go

20 lines
1.1 KiB
Go
Raw Permalink Normal View History

// 功能保存用户对真实业务消息的已读回执版本1.0.0。
package models
import (
"time"
"git.apinb.com/bsm-sdk/core/database"
)
// UserMessageRead 仅保存已读状态,消息正文仍来自订单、工单或公告事实表。
type UserMessageRead struct {
Entity // 公共实体字段
UserAccountID uint64 `gorm:"column:user_account_id;not null;index;uniqueIndex:ux_user_message_read;comment:读取消息的用户账号内部主键" json:"user_account_id"` // 用户账号内部主键
MessageKey string `gorm:"column:message_key;type:varchar(96);not null;uniqueIndex:ux_user_message_read;comment:消息来源类型与业务唯一标识组成的稳定键" json:"message_key"` // 稳定消息键
ReadAt time.Time `gorm:"column:read_at;type:timestamptz;not null;comment:用户首次确认已读的时间" json:"read_at"` // 首次已读时间
}
func init() { database.AppendMigrate(&UserMessageRead{}) }
func (table *UserMessageRead) TableName() string { return "user_message_read" }