Update README

This commit is contained in:
2026-04-24 14:23:38 +03:30
parent cc9ad9520c
commit e7fce5efe8
+23 -14
View File
@@ -23,31 +23,40 @@ Note: Detailed TODO comments are provided inside Rational.java.
## Part 2: Movie Explorer 🎬 (Using API)
In this part, you will develop a Java application that fetches movie data from an API and allows users to browse and search movies.
Files Provided:
Movie.java
### Files Provided
- `Movie.java`
- `Genre.java`
- `MovieService.java`
- `Main.java`
Genre.java
We have already implemented two methods that call the API and return the raw JSON response as a `String`:
MovieService.java
- `getGenresList()` → calls the API and returns the list of genres in JSON format.
- `getMoviesByGenreList(Long genreId, Long page)` → calls the API and returns the list of movies for a specific genre and page in JSON format.
Main.java
Tasks:
Complete the Movie class (fields, constructor, getters/setters)
### Your Tasks
Complete the Genre class (fields, constructor, getters/setters)
1. Complete the `Genre` class (fields, constructor, getters, and setters).
Parse JSON data from getGenresList() into a list of Genre objects
2. Complete the `Movie` class (fields, constructor, getters, and setters).
Display the list of genres to the user
3. Write a method that receives the JSON string returned by `getGenresList()` and converts it into a `List<Genre>`.
Fetch and return a list of movies by genreId and page number
4. Write another method that prints the list of genres in a clean and readable format for the user.
Display the genres of a specific movie
5. Write a method that receives the JSON string returned by `getMoviesByGenreList()` and converts it into a `List<Movie>`.
Implement a console menu in Main to receive user input and display data
6. Write another method that displays the list of movies in a clean and readable format.
Note: Detailed TODO comments are provided inside each of the above source files.
7. Implement a console menu in `Main` that allows the user to:
- View the list of genres
- Select a genre
- View movies for the selected genre (with pagination)
### Note
To understand what fields should exist in the `Genre` and `Movie` classes, it is recommended that you first call the two API methods once and inspect the raw JSON response. This will help you determine the exact structure of the data and define the appropriate class fields.
---
## Objectives ✏️