menu

package
v0.0.0-...-bc6e940 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package menu contains the menu controller

Package menu contains the menu controller

Package menu contains the menu controller

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	MenuService useCaseMenu.Service
}

Controller is a struct that contains the menu service

func (*Controller) DeleteMenu

func (c *Controller) DeleteMenu(ctx *gin.Context)

DeleteMenu is the controller to delete a menu

@Tags			menus
@Summary		Delete menus by ID
@Description	Delete Menus by ID on the system
@Param			menu_id	path		int64	true	"id of menu"
@Success		200			{object}	MessageResponse
@Failure		400			{object}	MessageResponse
@Failure		500			{object}	MessageResponse
@Router			/menus/{menu_id} [delete]

func (*Controller) GetAllMenus

func (c *Controller) GetAllMenus(ctx *gin.Context)

GetAllMenus godoc

@Tags			menus
@Summary		Get all Menus
@Description	Get all Menus on the system
@Param			limit	query		int64	true	"limit"
@Param			page	query		int64	true	"page"
@Success		200		{object}	[]useCaseMenu.PaginationResultMenu
@Failure		400		{object}	MessageResponse
@Failure		500		{object}	MessageResponse
@Router			/menus [get]

func (*Controller) GetMenusByID

func (c *Controller) GetMenusByID(ctx *gin.Context)

GetMenusByID godoc

@Tags			menus
@Summary		Get menus by ID
@Description	Get Menus by ID on the system
@Param			menu_id	path		int64	true	"id of menu"
@Success		200			{object}	domainMenu.Menu
@Failure		400			{object}	MessageResponse
@Failure		500			{object}	MessageResponse
@Router			/menus/{menu_id} [get]

func (*Controller) GetTopMenus

func (c *Controller) GetTopMenus(ctx *gin.Context)

GetTopMenus godoc

	@Tags			menus
	@Summary		Get top menus by count
	@Description	Get Top Menus by count on the system
    @Param          count       query int true     "top count"
	@Success		200			{object}	[]domainMenu.Menu
	@Failure		400			{object}	MessageResponse
	@Failure		500			{object}	MessageResponse
	@Router			/menus/top [get]

func (*Controller) NewMenu

func (c *Controller) NewMenu(ctx *gin.Context)

NewMenu godoc

@Tags			menus
@Summary		Create New Menu
@Description	Create new menu on the system
@Accept			json
@Produce		json
@Param			data	body		NewMenuRequest	true	"body data"
@Success		201		{object}	domainMenu.Menu
@Failure		400		{object}	MessageResponse
@Failure		500		{object}	MessageResponse
@Router			/menus [post]

type MessageResponse

type MessageResponse struct {
	Message string `json:"message"`
}

MessageResponse is a struct that contains the response body for the message

type NewMenuRequest

type NewMenuRequest struct {
	Name        string  `json:"name" example:"Paracetamol" binding:"required"`
	Description string  `json:"description" example:"Something" binding:"required"`
	Price       float64 `json:"price" example:"200.50" binding:"required"`
}

NewMenuRequest is a struct that contains the new menu request information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL