cartItem one2one relation to shopitem
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
type CartItem struct {
|
||||
gorm.Model
|
||||
SessionId string `gorm:"index"`
|
||||
ShopItemId int `gorm:"index"`
|
||||
Quantity int
|
||||
SessionId string `json:"sessionid" binding:"required" gorm:"not null"`
|
||||
ShopItem ShopItem `json:"shopitem" gorm:"foreignKey:ID"` //gorm one2one
|
||||
Quantity int `json:"quantity" binding:"required"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user