feat kafka 改版 2
This commit is contained in:
38
internal/dao/model/point_card.gen.go
Normal file
38
internal/dao/model/point_card.gen.go
Normal file
@@ -0,0 +1,38 @@
|
||||
// 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 <point_card>
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user