// Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. package model import ( "time" "git.hlsq.asia/mmorpg/service-common/utils" "gorm.io/gorm" ) const TableNamePointRecord = "point_records" // PointRecord mapped from table type PointRecord struct { ID uint64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` Sn string `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 UserSn string `gorm:"column:user_sn;not null;comment:用户-唯一编号" json:"user_sn"` // 用户-唯一编号 /* 来源: 0. 未知 1. 随机答题 2. 类目答题 3. 限时答题 */ Source int32 `gorm:"column:source;not null;comment:来源:\n0. 未知\n1. 随机答题\n2. 类目答题\n3. 限时答题" json:"source"` Point int64 `gorm:"column:point;not null;comment:积分" json:"point"` // 积分 CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"` } // TableName PointRecord's table name func (*PointRecord) TableName() string { return TableNamePointRecord } // Auto sn func (m *PointRecord) BeforeCreate(_ *gorm.DB) error { if m.Sn == "" { m.Sn = utils.SnowflakeInstance().Generate().String() } return nil }