19 lines
700 B
Go
19 lines
700 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Products struct {
|
|
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
|
Title string `json:"title" gorm:"type:varchar"`
|
|
Variant *string `json:"variant" gorm:"type:varchar"`
|
|
Price *float64 `json:"price" gorm:"type:decimal(10,2)"`
|
|
ThumbnailPath *string `json:"thumbnail_path" gorm:"type:varchar"`
|
|
Colors *string `json:"colors" gorm:"type:text"` // JSON array stored as text
|
|
IsActive *bool `json:"is_active" gorm:"type:bool;default:true"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
|
}
|
|
|