complete Main class
This commit is contained in:
@@ -21,14 +21,25 @@ public class Main {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
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;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 3:
|
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;
|
break;
|
||||||
|
|
||||||
@@ -45,7 +56,7 @@ public class Main {
|
|||||||
if (running) {
|
if (running) {
|
||||||
System.out.println("\nPress Enter to continue...");
|
System.out.println("\nPress Enter to continue...");
|
||||||
scanner.nextLine();
|
scanner.nextLine();
|
||||||
scanner.nextLine();
|
//scanner.nextLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user