修改秒杀
This commit is contained in:
25
model/good/goods.go
Normal file
25
model/good/goods.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package good
|
||||
|
||||
import "time"
|
||||
|
||||
type Goods struct {
|
||||
GID string `gorm:"column:gid"`
|
||||
Stock int `gorm:"column:stock"`
|
||||
StartTime time.Time `gorm:"column:start_time"`
|
||||
EndTime time.Time `gorm:"column:end_time"`
|
||||
}
|
||||
|
||||
// Order 订单模型,对应 orders_list 表
|
||||
type Order struct {
|
||||
OrderId string `gorm:"column:order_id"` // 关联商品ID
|
||||
TradeTime time.Time `gorm:"column:trade_time"`
|
||||
}
|
||||
|
||||
// 为模型指定数据库表名
|
||||
func (Goods) TableName() string {
|
||||
return "goods_list"
|
||||
}
|
||||
|
||||
func (Order) TableName() string {
|
||||
return "oders_list"
|
||||
}
|
||||
Reference in New Issue
Block a user