Documentation ¶
Index ¶
- func CategoriesListPgToEntity(c []*Category) []*entities.Category
- func CategoryPgToEntity(c *Category) *entities.Category
- func ImagePgToEntity(image *Image) *entities.Image
- func ImagesListPgToEntity(images []Image) []*entities.Image
- func ManufacturerPgToEntity(m *Manufacturer) *entities.Manufacturer
- func ManufacturersListPgToEntity(m []*Manufacturer) []*entities.Manufacturer
- func Migrate(db *gorm.DB) error
- func ProductPgToEntity(c *Product) *entities.Product
- func ProductsListPgToEntity(p []*Product) []*entities.Product
- type Base
- type Category
- type Image
- type Manufacturer
- type Product
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CategoryPgToEntity ¶
func ImagePgToEntity ¶
func ImagesListPgToEntity ¶
func ManufacturerPgToEntity ¶
func ManufacturerPgToEntity(m *Manufacturer) *entities.Manufacturer
func ManufacturersListPgToEntity ¶
func ManufacturersListPgToEntity(m []*Manufacturer) []*entities.Manufacturer
func ProductPgToEntity ¶
func ProductsListPgToEntity ¶
Types ¶
type Category ¶
type Category struct { Base Name string Description string ParentID *string `gorm:"type:uuid"` Children []Category `gorm:"foreignkey:ParentID"` Products []*Product `gorm:"many2many:product_categories;"` Order int Image *Image `gorm:"polymorphic:Owner;"` }
func CategoryEntityToPg ¶
type Image ¶
type Image struct { ID string `gorm:"type:uuid"` OwnerID string `gorm:"type:uuid"` OwnerType string Extension string // File extension Order int }
func ImageEntityToPg ¶
func ImagesListEntityToPg ¶
type Manufacturer ¶
type Manufacturer struct { Base Name string WebsiteURL string Image *Image `gorm:"polymorphic:Owner;"` }
func ManufacturerEntityToPg ¶
func ManufacturerEntityToPg(e *entities.Manufacturer) *Manufacturer
type Product ¶
type Product struct { Base Name string DescriptionShort string DescriptionLong string Price int Categories []Category `gorm:"many2many:product_categories;"` ManufacturerID *string `gorm:"type:uuid"` Status string StockCount int Images []Image `gorm:"polymorphic:Owner;"` }
func ProductEntityToPg ¶
Click to show internal directories.
Click to hide internal directories.