| 12345678910111213141516171819202122232425262728293031323334353637 |
- package fr.natan.akkastreamfileprocessingapi.controller;
-
- import fr.natan.akkastreamfileprocessingapi.service.AkkaStreamFileProcessing;
- import org.springframework.http.HttpStatus;
- import org.springframework.http.ResponseEntity;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RestController;
-
- @RestController
- public class MovieController {
-
- private final AkkaStreamFileProcessing akkaStreamFilesProcessing;
-
- public MovieController(AkkaStreamFileProcessing akkaStreamFilesProcessing) {
- this.akkaStreamFilesProcessing = akkaStreamFilesProcessing;
- }
-
- @RequestMapping(value = "/movies", method = RequestMethod.GET)
- private ResponseEntity<String> getAllMovies() {
- akkaStreamFilesProcessing.getAllMovies();
- return new ResponseEntity<>("is running", HttpStatus.OK);
- }
-
- @RequestMapping(value = "/movies/{movieTitle}", method = RequestMethod.GET)
- private ResponseEntity<String> getMovieByTitle(@PathVariable(name ="movieTitle" ) String movieTitle){
- akkaStreamFilesProcessing.getMoviesByTitle(movieTitle);
- return new ResponseEntity<>("is running", HttpStatus.OK);
- }
-
- @RequestMapping(value = "/persons", method = RequestMethod.GET)
- private ResponseEntity<String> getallPersons(){
- akkaStreamFilesProcessing.getAllPersons();
- return new ResponseEntity<>("is running", HttpStatus.OK);
- }
- }
|