Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type CommentLikes ¶
type ProductImages ¶
type Products ¶
type Products struct { common.SlugModel Name string `gorm:"size:75;not null;index" example:"Phone"` Description string `gorm:"size:300;not null" example:"Phone Description"` Price float64 `gorm:"not null" example:"599"` Stock int `gorm:"not null" example:"6"` IsAvailable bool `gorm:"not null" example:"true"` Weight float64 `gorm:"not null" example:"0.7"` Views int `gorm:"not null"` CategorySlug string `gorm:"not null" json:"category_slug" example:"digital"` Images []ProductImages `gorm:"foreignKey:ProductsSlug;references:Slug"` Comments []Comments `gorm:"foreignKey:ProductsSlug;references:Slug"` Tags []Tags `gorm:"many2many:product_tags"` }
type Tags ¶
type Tags struct { common.ModelCreate Name string `gorm:"not null;index;unique"` }
type Users ¶
type Users struct { common.Model FirstName string `gorm:"size:75;not null" json:"first_name"` LastName string `gorm:"size:75;not null" json:"last_name"` Phone string `gorm:"size:75;not null;index;unique" json:"phone"` Password string `gorm:"size:300;not null" json:"-"` IsActive bool `gorm:"not null;default:false" json:"is_active"` IsAdmin bool `gorm:"not null;default:false" json:"is_admin"` Comments []Comments `gorm:"foreignKey:UsersID;references:ID"` }
Click to show internal directories.
Click to hide internal directories.