Initial commit: 商品售卖网站
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Inventory struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
ProductID uint `gorm:"index;not null" json:"product_id"`
|
||||
SupplierID uint `gorm:"index;not null" json:"supplier_id"`
|
||||
Quantity int `gorm:"default:0" json:"quantity"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
func (Inventory) TableName() string {
|
||||
return "inventory"
|
||||
}
|
||||
Reference in New Issue
Block a user