Commit 43483bf8 by Rubén Ramírez

feat: [RecursosController]: Creada la funcionalidad en el controlador de…

feat: [RecursosController]: Creada la funcionalidad en el controlador de recursos para añadir un nuevo recurso
parent 640c4aa8
package com.ujaen.tfg.mangaffinity.rest;
import com.ujaen.tfg.mangaffinity.entidades.Recurso;
import com.ujaen.tfg.mangaffinity.servicios.ServicioRecursos;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/recursos")
public class RecursosController {
@Autowired
private ServicioRecursos servicioRecursos;
@PostMapping("/")
public ResponseEntity<Void> crearRecurso(@RequestBody @Valid Recurso recurso) {
servicioRecursos.crearRecurso(recurso);
return ResponseEntity.status(HttpStatus.CREATED).build();
}
}
\ No newline at end of file
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