26 lines
844 B
Go
26 lines
844 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
// SeqType 序列类型
|
|
type SeqType string
|
|
|
|
const (
|
|
SeqTypeTrade SeqType = "TRADE"
|
|
SeqTypeRefund SeqType = "REFUND"
|
|
SeqTypeSharing SeqType = "SHARING"
|
|
)
|
|
|
|
// OrderSequence 订单编码序列
|
|
type OrderSequence struct {
|
|
ID uint64 `gorm:"column:id;primaryKey;autoIncrement"`
|
|
AppID string `gorm:"column:app_id;size:32;not null;uniqueIndex:uk_app_type"`
|
|
SeqType SeqType `gorm:"column:seq_type;size:20;not null;uniqueIndex:uk_app_type"`
|
|
Prefix string `gorm:"column:prefix;size:8;not null"`
|
|
CurrentValue uint64 `gorm:"column:current_value;not null;default:0"`
|
|
Step int `gorm:"column:step;not null;default:1"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime:milli"`
|
|
}
|
|
|
|
func (OrderSequence) TableName() string { return "order_sequence" }
|