update
This commit is contained in:
@@ -7,13 +7,16 @@ import (
|
||||
|
||||
/*
|
||||
Sticker
|
||||
- name, abstr, descr, price, tag
|
||||
- name, abstr, descr, price, tag
|
||||
|
||||
Poster
|
||||
- name, abstr, descr, price bw/colored, tag
|
||||
- name, abstr, descr, price bw/colored, tag
|
||||
|
||||
Zines
|
||||
- name, abstr, descr, price bw/colored/coloredcoveronly, tag
|
||||
- name, abstr, descr, price bw/colored/coloredcoveronly, tag
|
||||
|
||||
Books
|
||||
- name, abstr, descr, price, tag
|
||||
- name, abstr, descr, price, tag
|
||||
*/
|
||||
type Category string
|
||||
|
||||
@@ -31,22 +34,22 @@ func ParseCategory(s string) (c Category, err error) {
|
||||
|
||||
type ItemVariant struct {
|
||||
gorm.Model
|
||||
Name string `json:"name" gorm:"not null"`
|
||||
Price float64 `json:"price" gorm:"not null"`
|
||||
InStock bool `json:"inStock" gorm:"default:true"`
|
||||
Name string `json:"name" gorm:"not null"`
|
||||
Price float64 `json:"price" gorm:"not null"`
|
||||
InStock bool `json:"inStock" gorm:"default:true"`
|
||||
ShopItemID uint
|
||||
}
|
||||
|
||||
type ShopItem struct {
|
||||
gorm.Model
|
||||
Name string `json:"name" binding:"required" gorm:"unique;not null"`
|
||||
Abstract string `json:"Abstract" binding:"required"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
Category Category `json:"category"`
|
||||
Variants []ItemVariant `json:"variant"`
|
||||
BasePrice float64 `json:"basePrice"`
|
||||
IsPublic bool `json:"isPublic" gorm:"default:true"`
|
||||
Tags []Tag `gorm:"many2many:item_tags;"`
|
||||
Image string
|
||||
Pdf string
|
||||
Name string `json:"name" binding:"required" gorm:"unique;not null"`
|
||||
Abstract string `json:"Abstract" binding:"required"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
Category Category `json:"category"`
|
||||
Variants []ItemVariant `json:"variant"`
|
||||
BasePrice float64 `json:"basePrice"`
|
||||
IsPublic bool `json:"isPublic" gorm:"default:true"`
|
||||
Tags []Tag `gorm:"many2many:item_tags;"`
|
||||
Image string
|
||||
Pdf string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user