Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormRepository ¶
func NewGormDBRepository ¶
func NewGormDBRepository(db *gorm.DB) *GormRepository
func (*GormRepository) AddProduct ¶
func (repo *GormRepository) AddProduct(product product.Product) error
func (*GormRepository) FindProductById ¶
func (repo *GormRepository) FindProductById(id int) (*product.Product, error)
func (*GormRepository) UpdateProduct ¶
func (repo *GormRepository) UpdateProduct(product product.Product) error
type Product ¶
type Product struct { ID uint `gorm:"id;primaryKey;autoIncrement"` CategoryID uint `gorm:"category_id"` Name string `gorm:"name"` Price int `gorm:"price"` Stock int `gorm:"stock"` Image string `gorm:"image"` Detail string `gorm:"detail"` CreatedAt time.Time `gorm:"created_at"` UpdatedAt time.Time `gorm:"updated_at"` DeletedAt *time.Time `gorm:"deleted_at"` }
Click to show internal directories.
Click to hide internal directories.