Documentation
¶
Index ¶
- type CartHandler
- func (h *CartHandler) AddItem(c *gin.Context)
- func (h *CartHandler) AddVasItem(c *gin.Context)
- func (h *CartHandler) ApplyPromotion(c *gin.Context)
- func (h *CartHandler) Display(c *gin.Context)
- func (h *CartHandler) RemoveItem(c *gin.Context)
- func (h *CartHandler) RemoveVasItem(c *gin.Context)
- func (h *CartHandler) ResetCart(c *gin.Context)
- type CategoryHandler
- type ItemHandler
- type PromotionHandler
- type VasItemHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartHandler ¶
type CartHandler struct {
// contains filtered or unexported fields
}
func NewCartHandler ¶
func NewCartHandler(cartApp application.CartAppInterface) *CartHandler
func (*CartHandler) AddItem ¶
func (h *CartHandler) AddItem(c *gin.Context)
@Summary Add item @Description Add an item to a cart @Tags Cart @Accept json @Produce json @Param cartId path int true "Cart ID" @Param item body dto.ItemCreateRequest true "Item" @Success 200 {string} string "Item added successfully" @Router /api/v1/cart/{cartId}/item [post]
func (*CartHandler) AddVasItem ¶
func (h *CartHandler) AddVasItem(c *gin.Context)
@Summary Add vas item @Description Add a vas item to a cart @Tags Cart @Accept json @Produce json @Param item body dto.VasItemCreateRequest true "VasItem" @Router /api/v1/cart/{cartId}/item/{itemId}/vas-item/{vasItemId} [post]
func (*CartHandler) ApplyPromotion ¶
func (h *CartHandler) ApplyPromotion(c *gin.Context)
@Summary Apply promotion @Description Apply a promotion to a cart @Tags Cart @Accept json @Produce json @Param cartId path int true "Cart ID" @Param promotionId path int true "Promotion ID" @Success 200 {string} string "Promotion applied successfully" @Failure 409 {string} string "Promotion already applied" @Router /api/v1/cart/{cartId}/promotion/{promotionId} [post]
func (*CartHandler) Display ¶
func (h *CartHandler) Display(c *gin.Context)
@Summary Display cart @Description Display a cart @Tags Cart @Accept json @Produce json @Param cartId path int true "Cart ID" @Success 200 {object} string "Cart displayed successfully" @Router /api/v1/cart/{cartId} [get]
func (*CartHandler) RemoveItem ¶
func (h *CartHandler) RemoveItem(c *gin.Context)
@Summary Remove Item from cart @Description Remove an item from a cart @Tags Cart @Accept json @Produce json @Param itemId path int true "Item ID" @Success 200 {string} string "Item removed successfully" @Router /api/v1/cart/item/{itemId} [delete]
func (*CartHandler) RemoveVasItem ¶
func (h *CartHandler) RemoveVasItem(c *gin.Context)
@Summary Remove vas item from cart @Description Remove a vas item from a cart @Tags Cart @Accept json @Produce json @Param vasItemId path int true "Vas Item ID" @Success 200 {string} string "Vas item removed successfully" @Router /api/v1/cart/vas-item/{vasItemId} [delete]
func (*CartHandler) ResetCart ¶
func (h *CartHandler) ResetCart(c *gin.Context)
@Summary Reset cart @Description Reset a cart @Tags Cart @Accept json @Produce json @Param cartId path int true "Cart ID" @Success 200 {string} string "Cart reset successfully" @Router /api/v1/cart/{cartId} [delete]
type CategoryHandler ¶
type CategoryHandler struct {
// contains filtered or unexported fields
}
func NewCategoryHandler ¶
func NewCategoryHandler(categoryApp application.CategoryAppInterface) *CategoryHandler
func (*CategoryHandler) Create ¶
func (h *CategoryHandler) Create(c *gin.Context)
@Summary Create a category @Description Create a new category @Tags Category @Accept json @Produce json @Param category body dto.CategoryRequest true "Category object" @Success 200 {object} string @Router /api/v1/category [post]
func (*CategoryHandler) GetById ¶
func (h *CategoryHandler) GetById(c *gin.Context)
@Summary Get a category by ID @Description Get a category by ID @Tags Category @Produce json @Param id path string true "Category ID" @Success 200 {object} string @Router /api/v1/category/{id} [get]
func (*CategoryHandler) List ¶
func (h *CategoryHandler) List(c *gin.Context)
@Summary List categories @Description Get a list of categories @Tags Category @Produce json @Success 200 {object} []entity.Category @Router /api/v1/category/list [get]
type ItemHandler ¶
type ItemHandler struct {
// contains filtered or unexported fields
}
func NewItemHandler ¶
func NewItemHandler(itemApp application.ItemAppInterface) *ItemHandler
func (*ItemHandler) GetById ¶
func (h *ItemHandler) GetById(c *gin.Context)
@Summary Get an item by ID @Description Get an item by its ID @Tags Item @Accept json @Produce json @Param id path int true "Item ID" Format(int) @Success 200 {object} string @Failure 400 {object} map[string]interface{} "Bad Request" @Failure 500 {object} map[string]interface{} "Internal Server Error" @Router /api/v1/item/{id} [get]
func (*ItemHandler) ListByCartId ¶
func (h *ItemHandler) ListByCartId(c *gin.Context)
@Summary List items @Description Get a list of items @Tags Item @Produce json @Param cart_id query int true "Cart ID" Format(int) @Success 200 {object} []entity.Item @Router /api/v1/item/list [get]
type PromotionHandler ¶
type PromotionHandler struct {
// contains filtered or unexported fields
}
func NewPromotionHandler ¶
func NewPromotionHandler(promotionApp application.PromotionAppInterface) *PromotionHandler
func (*PromotionHandler) Create ¶
func (h *PromotionHandler) Create(c *gin.Context)
@Summary Create a promotion @Description Create a new promotion @Tags Promotion @Accept json @Produce json @Param promotion body dto.PromotionRequest true "Promotion object" @Success 200 {string} string "Promotion created successfully" @Router /api/v1/promotion [post]
func (*PromotionHandler) GetById ¶
func (h *PromotionHandler) GetById(c *gin.Context)
@Summary Get a promotion by ID @Description Get a promotion by its ID @Tags Promotion @Produce json @Param id path int true "Promotion ID" @Success 200 {object} string @Router /api/v1/promotion/{id} [get]
func (*PromotionHandler) List ¶
func (h *PromotionHandler) List(c *gin.Context)
@Summary List promotions @Description Get a list of promotions @Tags Promotion @Produce json @Success 200 {object} []entity.Promotion @Router /api/v1/promotion/list [get]
type VasItemHandler ¶
type VasItemHandler struct {
// contains filtered or unexported fields
}
func NewVasItemHandler ¶
func NewVasItemHandler(vasItemApp application.VasItemAppInterface) *VasItemHandler
func (*VasItemHandler) GetById ¶
func (h *VasItemHandler) GetById(c *gin.Context)
@Summary Get vas item @Description Get a vas item @Tags VasItem @Produce json @Param id path int true "Vas Item ID" Format(int) @Success 200 {object} []entity.VasItem @Router /api/v1/vasitem/{id} [get]
func (*VasItemHandler) ListByItemId ¶
func (h *VasItemHandler) ListByItemId(c *gin.Context)
@Summary List vas items @Description Get a list of vas items @Tags VasItem @Produce json @Param item_id query int true "Item ID" Format(int) @Success 200 {object} []entity.VasItem @Router /api/v1/vasitem/list [get]