Documentation
¶
Overview ¶
Package order contains the order controller
Package order contains the order controller ¶
Package order contains the order controller
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
OrderService useCaseOrder.Service
}
Controller is a struct that contains the order service
func (*Controller) DeleteOrder ¶
func (c *Controller) DeleteOrder(ctx *gin.Context)
DeleteOrder is the controller to delete a order
@Tags orders
@Summary Delete orders by ID
@Description Delete orders by ID on the system
@Param order_id path int64 true "id of order"
@Success 200 {object} MessageResponse
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /orders/{order_id} [delete]
func (*Controller) GetOrdersByDinerID ¶
func (c *Controller) GetOrdersByDinerID(ctx *gin.Context)
GetOrdersByDinerID godoc
@Tags orders
@Summary Get orders by Diner ID
@Description Get orders by Diner ID on the system
@Param diner_id path int64 true "id of diner"
@Success 200 {object} []domainOrder.Response
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /orders/{diner_id} [get]
func (*Controller) NewOrder ¶
func (c *Controller) NewOrder(ctx *gin.Context)
NewOrder godoc
@Tags orders
@Summary Create New order
@Description Create new order on the system
@Accept json
@Produce json
@Param data body NewOrderRequest true "body data"
@Success 201 {object} domainOrder.Request
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /orders [post]
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message"`
}
MessageResponse is a struct that contains the response body for the message
type NewOrderRequest ¶
type NewOrderRequest struct {
DinnerID int64 `json:"diner_id" example:"1" binding:"required"`
MenuID int64 `json:"menu_id" example:"3" binding:"required"`
Quantity int `json:"quantity" example:"2" binding:"required"`
}
NewOrderRequest is a struct that contains the new order request information
Click to show internal directories.
Click to hide internal directories.