Documentation
¶
Overview ¶
Package diner contains the diner controller
Package diner contains the diner controller ¶
Package diner contains the diner controller
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
DinerService useCaseDiner.Service
}
Controller is a struct that contains the diner service
func (*Controller) DeleteDiner ¶
func (c *Controller) DeleteDiner(ctx *gin.Context)
DeleteDiner is the controller to delete a diner
@Tags diners
@Summary Delete diners by ID
@Description Delete Diners by ID on the system
@Param diner_id path int64 true "id of diner"
@Success 200 {object} MessageResponse
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /diners/{diner_id} [delete]
func (*Controller) GetAllDiners ¶
func (c *Controller) GetAllDiners(ctx *gin.Context)
GetAllDiners godoc
@Tags diners
@Summary Get all Diners
@Description Get all Diners on the system
@Param limit query int64 true "limit"
@Param page query int64 true "page"
@Success 200 {object} []useCaseDiner.PaginationResultDiner
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /diners [get]
func (*Controller) GetDinersByID ¶
func (c *Controller) GetDinersByID(ctx *gin.Context)
GetDinersByID godoc
@Tags diners
@Summary Get diners by ID
@Description Get Diners by ID on the system
@Param diner_id path int64 true "id of diner"
@Success 200 {object} domainDiner.Diner
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /diners/{diner_id} [get]
func (*Controller) NewDiner ¶
func (c *Controller) NewDiner(ctx *gin.Context)
NewDiner godoc
@Tags diners
@Summary Create New Diner
@Description Create new diner on the system
@Accept json
@Produce json
@Param data body NewDinerRequest true "body data"
@Success 201 {object} domainDiner.Diner
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /diners [post]
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message"`
}
MessageResponse is a struct that contains the response body for the message
type NewDinerRequest ¶
type NewDinerRequest struct {
Name string `json:"name" example:"Mr. Smith" binding:"required"`
TableNumber int `json:"table_no" example:"101" binding:"required"`
}
NewDinerRequest is a struct that contains the new diner request information
Click to show internal directories.
Click to hide internal directories.