feat(DeleteRecipe): implementado controlador para eliminar recetas básico

parent 9b9a98e7
package com.example.apprecetas.recipe.infrastructure.controller;
import com.example.apprecetas.recipe.application.DeleteRecipeUseCase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/recipe")
public class DeleteRecipeController {
@Autowired
private DeleteRecipeUseCase service;
@DeleteMapping("/{id}")
public ResponseEntity<String> delete(@PathVariable Long id) {
service.delete(id);
return ResponseEntity.ok().body("La receta con id " + id + " se ha eliminado correctamente.");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment