This is a Spring Boot web controller for managing peliculas (movies) in the NetFilm application. It is part of a larger system that handles multimedia content, with a focus on peliculas. The controller provides endpoints for creating, updating, deleting, and retrieving peliculas.
- Spring Boot
- Java
- Maven
POST /peliculas/guardar
Create and save a new pelicula.
Request:
{
// Pelicula details here
}
Response:
- Status: 201 Created
- Body: The created pelicula details.
GET /peliculas/buscarTodo
Retrieve a list of all peliculas.
Response:
- Status: 200 OK
- Body: A list of pelicula details.
PUT /peliculas/actualizar/
Update an existing pelicula.
Request:
{
// Updated pelicula details here
}
Response:
- Status: 200 OK if the update is successful, 404 Not Found otherwise.
DELETE /peliculas/borrar/{id}
Delete a pelicula by its ID.
Response:
- Status: 200 OK if the deletion is successful, 404 Not Found otherwise.
GET /peliculas/buscar/{id}
Retrieve a pelicula by its ID.
Response:
- Status: 200 OK with the pelicula details if found, 404 Not Found otherwise.
- PeliculaService
- MultimediaService
- MultimediaRepository
The controller is configured with the necessary services and repositories through dependency injection in the constructor.
@Autowired
public PeliculaController(PeliculaService peliculaService, MultimediaService multimediaService) {
this.peliculaService = peliculaService;
this.multimediaService = multimediaService;
}
To build and run the application, ensure that you have Maven and Java installed. Run the following command:
mvn spring-boot:run
The application will be accessible on http://localhost:8080
.