// 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 TableNamePointCard = "point_card" // PointCard mapped from table type PointCard 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"` // 用户-唯一编号 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 PointCard's table name func (*PointCard) TableName() string { return TableNamePointCard } // Auto sn func (m *PointCard) BeforeCreate(_ *gorm.DB) error { if m.Sn == "" { m.Sn = utils.SnowflakeInstance().Generate().String() } return nil }