draft
This commit is contained in:
25
backend/internal/model/order_sequence.go
Normal file
25
backend/internal/model/order_sequence.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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" }
|
||||
Reference in New Issue
Block a user