No Description

MovieController.java 1.3KB

12345678910111213141516171819202122232425262728293031
  1. package fr.natan.akkastreamfileprocessingapi.controller;
  2. import fr.natan.akkastreamfileprocessingapi.service.AkkaStreamFileProcessing;
  3. import org.springframework.http.HttpStatus;
  4. import org.springframework.http.ResponseEntity;
  5. import org.springframework.web.bind.annotation.PathVariable;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestMethod;
  8. import org.springframework.web.bind.annotation.RestController;
  9. @RestController
  10. public class MovieController {
  11. private final AkkaStreamFileProcessing akkaStreamFilesProcessing;
  12. public MovieController(AkkaStreamFileProcessing akkaStreamFilesProcessing) {
  13. this.akkaStreamFilesProcessing = akkaStreamFilesProcessing;
  14. }
  15. @RequestMapping(value = "/movies", method = RequestMethod.GET)
  16. private ResponseEntity<String> getAllMovies() {
  17. akkaStreamFilesProcessing.getAllMovies();
  18. return new ResponseEntity<>("IS RUNNING", HttpStatus.OK);
  19. }
  20. @RequestMapping(value = "/movies/{movieTitle}", method = RequestMethod.GET)
  21. private ResponseEntity<String> getMovieByTitle(@PathVariable(name ="movieTitle" ) String movieTitle){
  22. akkaStreamFilesProcessing.getMoviesByTitle(movieTitle);
  23. return new ResponseEntity<>("IS RUNNING", HttpStatus.OK);
  24. }
  25. }

Powered by TurnKey Linux.