16 lines
415 B
Go
16 lines
415 B
Go
package models
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type CartItem struct {
|
|
gorm.Model
|
|
SessionId string `json:"sessionid" binding:"required" gorm:"not null"`
|
|
ShopItemId uint
|
|
ShopItem ShopItem `json:"shopitem" gorm:"foreignKey:ShopItemId"` //gorm one2one
|
|
ItemVariantId uint
|
|
ItemVariant ItemVariant `json:"itemvariant" gorm:"foreignKey:ItemVariantId"` //gorm one2one
|
|
Quantity int `json:"quantity" binding:"required"`
|
|
}
|