23 lines
1.6 KiB
Go
23 lines
1.6 KiB
Go
|
|
package models
|
||
|
|
|
||
|
|
import (
|
||
|
|
"git.apinb.com/bsm-sdk/core/database"
|
||
|
|
"time"
|
||
|
|
)
|
||
|
|
|
||
|
|
// CmsContentRead 保存用户对强制内容版本的阅读确认。
|
||
|
|
type CmsContentRead struct {
|
||
|
|
Entity // 公共实体字段
|
||
|
|
UserAccountID uint64 `gorm:"column:user_account_id;not null;uniqueIndex:idx_content_read_user_version" json:"user_account_id"` // 用户内部主键
|
||
|
|
CmsContentID uint64 `gorm:"column:cms_content_id;not null;uniqueIndex:idx_content_read_user_version" json:"cms_content_id"` // 内容内部主键
|
||
|
|
VersionNo int `gorm:"column:version_no;not null;uniqueIndex:idx_content_read_user_version" json:"version_no"` // 已确认内容版本
|
||
|
|
ShownAt time.Time `gorm:"column:shown_at;type:timestamptz;not null" json:"shown_at"` // 客户端展示时间
|
||
|
|
ConfirmedAt *time.Time `gorm:"column:confirmed_at;type:timestamptz" json:"confirmed_at"` // 用户确认时间
|
||
|
|
ClientVersion string `gorm:"column:client_version;type:varchar(64);not null;default:''" json:"client_version"` // 客户端版本
|
||
|
|
DeviceIdentity string `gorm:"column:device_identity;type:varchar(128);not null;default:''" json:"device_identity"` // 客户端设备标识
|
||
|
|
RequestNo string `gorm:"column:request_no;type:varchar(128);not null;uniqueIndex" json:"request_no"` // 确认幂等号
|
||
|
|
}
|
||
|
|
|
||
|
|
func init() { database.AppendMigrate(&CmsContentRead{}) }
|
||
|
|
func (*CmsContentRead) TableName() string { return "cms_content_read" }
|