package
Version:
v0.0.0-...-3dd6f4c
Opens a new window with list of versions in this module.
Published: Nov 14, 2023
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Image struct {
gorm.Model
ProductImage string `gorm:"not null" json:"product_image"`
CompressedProductImage string `json:"compressed_product_image"`
ProductID uint
}
type LoginInput struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
}
type Product struct {
gorm.Model
ProductName string `gorm:"size:255; not null" json:"product_name"`
ProductDescription string `gorm:"type:text; not null" json:"product_description"`
ProductPrice float64 `gorm:"not null" json:"product_price"`
UserID uint
Images []Image
}
type RegisterInput struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
Mobile string `json:"mobile" binding:"required"`
Latitude float64 `json:"latitude" binding:"required"`
Longitude float64 `json:"longitude" binding:"required"`
}
type User struct {
gorm.Model
Username string `gorm:"size:255;not null;uniqueIndex" json:"username"`
Password string `gorm:"size:255;not null;" json:"-"`
Mobile string `gorm:"unique;not null" json:"mobile"`
Latitude float64 `gorm:"not null;check:latitude >= -90 AND latitude <= 90" json:"latitude"`
Longitude float64 `gorm:"not null;check:longitude >= -180 AND longitude <= 180" json:"longitude"`
Products []Product
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.