Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RecipeHandler ¶
type RecipeHandler struct {
// contains filtered or unexported fields
}
func NewRecipeHandler ¶
func NewRecipeHandler(ctx context.Context, collection *mongo.Collection, redisClient *redis.Client) *RecipeHandler
func (*RecipeHandler) DeleteRecipe ¶
func (handler *RecipeHandler) DeleteRecipe(c *gin.Context)
DeleteRecipe Deletes model.Recipe by id
@Summary Delete recipe by id @Description Delete recipe by id @Tags Recipes @Param id path int true "ID of the recipe" @Success 204 @Failure 400 @Failure 500 @Router /recipes/{id} [delete]
func (*RecipeHandler) GetRecipe ¶
func (handler *RecipeHandler) GetRecipe(c *gin.Context)
GetRecipe Get model.Recipe by id
@Summary Get recipe by id @Description Get a single recipe by id @Tags Recipes @Success 200 {object} model.Recipe @Failure 404 @Failure 500 @Router /recipes/{id} [get]
func (*RecipeHandler) ListRecipes ¶
func (handler *RecipeHandler) ListRecipes(c *gin.Context)
ListRecipes Get all model.Recipe's
@Summary List all recipes @Description Get a list of all available recipes @Tags Recipes @Success 200 {object} model.Recipe @Failure 500 @Router /recipes [get]
func (*RecipeHandler) NewRecipe ¶
func (handler *RecipeHandler) NewRecipe(c *gin.Context)
NewRecipe Saves a new model.Recipe
@Summary Save a new recipe @Description Save a new recipe @Tags Recipes @Param request body recipeDTO true "new recipe" @Success 201 {object} model.Recipe @Failure 400 @Failure 500 @Router /recipes [post]
func (*RecipeHandler) UpdateRecipe ¶
func (handler *RecipeHandler) UpdateRecipe(c *gin.Context)
UpdateRecipe Updates model.Recipe by id
@Summary Update recipe by id @Description Update recipe by id @Tags Recipes @Param id path int true "ID of the recipe" @Param request body recipeDTO true "recipe for update" @Success 204 @Failure 400 @Failure 500 @Router /recipes/{id} [put]