Discover Packages
github.com/PacktPublishing/Hands-On-Full-Stack-Development-with-GO
Chapter07
backend
src
models
package
Version:
v0.0.0-...-990aa43
Opens a new window with list of versions in this module.
Published: Jan 30, 2023
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Customer struct {
gorm .Model
FirstName string `gorm:"column:firstname" json:"firstname"`
LastName string `gorm:"column:lastname" json:"lastname"`
Email string `gorm:"column:email" json:"email"`
Pass string `json:"password"`
CCToken string `gorm:"column:cctoken" json:"cctoken"`
LoggedIn bool `gorm:"column:loggedin" json:"loggedin"`
}
type Order struct {
gorm .Model
Product
Customer
CustomerID int `gorm:"column:customer_id"`
ProductID int `gorm:"column:product_id"`
Price float64 `gorm:"column:price" json:"sell_price"`
PurchaseDate time .Time `gorm:"column:purchase_date" json:"purchase_date"`
}
type Product struct {
gorm .Model
Image string `json:"img"`
ImagAlt string `json:"imgalt" gorm:"column:imgalt"`
Price float64 `json:"price"`
Promotion float64 `json:"promotion"`
PoructName string `gorm:"column:productname" json:"productname"`
Description string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.