complete Main class

This commit is contained in:
2026-04-30 12:34:49 +03:30
parent 3c3d1d73b3
commit f4a75e25bf
+16 -5
View File
@@ -21,14 +21,25 @@ public class Main {
break;
case 2:
// TODO: Get genre ID and page from user, then call movieService.displayMoviesByGenre()
long id = getLongInput("Enter genre ID: ");
long page = getLongInput("Enter page number: ");
movieService.displayMoviesByGenre(id, page);
break;
case 3:
// TODO (BONUS): Get movie ID from user, then call movieService.displayMovieDetails()
System.out.println("Enter movie ID to see details: ");
if (scanner.hasNextLong())
{
Long movieId = scanner.nextLong();
System.out.println("---Fetching movie details---");
movieService.displayMovieDetails(movieId);
}
else
{
System.out.println("Invalid ID.");
scanner.next();
}
break;
@@ -45,7 +56,7 @@ public class Main {
if (running) {
System.out.println("\nPress Enter to continue...");
scanner.nextLine();
scanner.nextLine();
//scanner.nextLine();
}
}