Initial commit: 商品售卖网站

This commit is contained in:
2026-04-13 07:20:09 +08:00
commit c6154273f2
865 changed files with 26573 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package models
import (
"time"
)
type Cart struct {
ID uint `gorm:"primaryKey" json:"id"`
UserID uint `gorm:"index;not null" json:"user_id"`
ProductID uint `gorm:"index;not null" json:"product_id"`
Quantity int `gorm:"not null" json:"quantity"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Product Product `json:"product,omitempty"`
}
func (Cart) TableName() string {
return "carts"
}