From 28212a75980cd41cac7973c8fb3e39b7e5834ea1 Mon Sep 17 00:00:00 2001 From: Partow Roshani Date: Fri, 24 Apr 2026 14:09:32 +0000 Subject: [PATCH] Update README.md --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 037b0df..2febd66 100644 --- a/README.md +++ b/README.md @@ -125,8 +125,55 @@ Understanding: You must be able to explain your implementation --- ## Bonus Tasks ✒️ -Parse the JSON returned by `getMovieInfo` into a `MovieInfo` entity and display structured movie details based on user-provided movie ID. +Fetch and display movie information using movie ID +In this section, you must implement the ability to search for a movie by its ID. The user enters an ID, and the program displays complete movie details. + +Movie Class Fields (already defined): + +- id (Long) - Movie identifier + +- title (String) - Movie title + +- year (String) - Release year + +- genres (List) - List of genres + +- images (String) - Poster image URL + +- country (String) - Production country + +- imdbRating (String) - IMDB rating + +Implementation Steps: + +1. Build and Send Request (getMovieById method): + +Create HTTP request to: https://api.meshcomp.ir/api/v1/movies/{movieId} + +Replace {movieId} with the ID from user + +Send request and get response + +2. Handle Response (getMovieById method): + +If status code is 200, return JSON body + +Otherwise, print error and return null + +3. Parse JSON and Create Movie Object (displayMovieDetails method): + +Parse JSON response to JsonObject + +Extract all fields: id, title, year, poster, country, imdb_rating + +Parse "genres" array and convert each to Genre object + +Create a Movie object with all extracted data + +4. Display Results (displayMovieDetails method): + +Print all movie details in a clean format Advanced search (title, genre, year, rating, etc.) Sorting options for movies