Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
UseCase UseCase
}
func (Controller) SearchProducts ¶
func (ctr Controller) SearchProducts(c *gin.Context)
type ProductRepositoryMock ¶
func (*ProductRepositoryMock) FindByKeyword ¶
func (repository *ProductRepositoryMock) FindByKeyword(keyword string) (products []*Products, err error)
type Products ¶
type Products struct { ID string `json:"id" gorm:"type:uuid;default:uuid_generate_v4();primary_key"` Name string `json:"name" gorm:"uniqueIndex"` Price int64 `json:"price"` PromoID string `json:"promoId"` Stock int64 `json:"stock"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type Promo ¶
type Promo struct { ID string `json:"id" gorm:"type:uuid;default:uuid_generate_v4();primary_key"` PromoCode string `json:"promoCode" gorm:"uniqueIndex"` PromoType string `json:"promoType"` Discount int64 `json:"discount"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type Repository ¶
func NewRepository ¶
func NewRepository(db *gorm.DB) Repository
type UseCase ¶
func NewUseCase ¶
func NewUseCase(repo Repository) UseCase
Click to show internal directories.
Click to hide internal directories.