22
33import app .betterhm .backend .v1 .component .MovieCache ;
44import app .betterhm .backend .v1 .models .movies .Movie ;
5- import app .betterhm .backend .v1 .services .MovieService ;
65import org .slf4j .Logger ;
76import org .slf4j .LoggerFactory ;
87import org .springframework .beans .factory .annotation .Autowired ;
98import org .springframework .web .bind .annotation .GetMapping ;
109import org .springframework .web .bind .annotation .RequestMapping ;
1110import org .springframework .web .bind .annotation .RestController ;
1211
13- import java .time .LocalDate ;
1412import java .util .List ;
15- import java .util .stream .Collectors ;
1613
1714@ RestController
1815@ RequestMapping ("/v1/movies" )
1916public class MovieController {
2017 private final MovieCache movieCache ;
21- private final MovieService movieService ;
2218
2319 private final Logger logger = LoggerFactory .getLogger (MovieController .class );
2420
2521 @ Autowired
26- public MovieController (MovieCache movieCache , MovieService movieService ) {
22+ public MovieController (MovieCache movieCache ) {
2723 this .movieCache = movieCache ;
28- this .movieService = movieService ;
2924 }
3025
3126 @ GetMapping
@@ -34,19 +29,4 @@ public List<Movie> getMovies() {
3429 logger .info ("Found {} movies" , movies .size ());
3530 return movies ;
3631 }
37-
38- @ GetMapping ("/fetch" )
39- public void fetch () {
40- movieService .updateMovies ();
41- }
42-
43- @ GetMapping ("/test" )
44- public List <Movie > test () {
45- Movie movie = new Movie (
46- "Inception" , LocalDate .of (2010 , 7 , 16 ), "20:00" , "FSK 12" , "Sci-Fi" , 148 ,
47- "A mind-bending thriller" , "The content of the movie" , "Room A" , "coverUrl" ,
48- "coverBlurhash" , "trailerUrl" , "unifilmUrl"
49- );
50- return List .of (movie ); // Return a list with one movie object for testing
51- }
5232}
0 commit comments