17 lines
486 B
Go
17 lines
486 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Product đại diện cho thông tin sản phẩm
|
|
type Product struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Name string `gorm:"size:255;not null" json:"name"`
|
|
Description string `gorm:"type:text" json:"description"`
|
|
Price float64 `gorm:"not null" json:"price"`
|
|
Quantity int `gorm:"not null" json:"quantity"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|