Commit 2a8f2a7c authored by Aleksandr Verevkin's avatar Aleksandr Verevkin
Browse files

Merge branch 'MovieManagementService' into 'main'

Add missing movie description

See merge request xheinz/pa165_movie_recommender!14
parents a5ae21c4 d9f6e8d2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ import java.util.List;

public record CreateMovieDto(@NotBlank(message = "Name cannot be empty") String name,
                             @NotBlank(message = "Director cannot be empty") String director,
                             @NotBlank(message = "Description cannot be empty") String description,

                             @NotEmpty(message = "Genres cannot be empty") Collection<MovieGenre> genres,
                             String imageUrl,
                             @NotEmpty(message = "At least one actor must be provided") List<String> actors) {
+20 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ public class MovieDto {
    private String name;
    @NotBlank(message = "Director cannot be empty")
    private String director;
    @NotBlank(message = "Description cannot be empty")
    private String description;
    @NotEmpty(message = "At least one actor must be provided")
    private List<String> actors;
    @NotEmpty(message = "Genres cannot be empty")
@@ -79,6 +81,24 @@ public class MovieDto {
        this.director = director;
    }

    /**
     * Gets the description of the movie.
     *
     * @return the description of the movie
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the description of the movie.
     *
     * @param description the description of the movie
     */
    public void setDescription(final String description) {
        this.description = description;
    }

    /**
     * Gets the actors of the movie.
     *
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ public class MovieMapper {
        movieDto.setId(movie.getId());
        movieDto.setName(movie.getName());
        movieDto.setDirector(movie.getDirector());
        movieDto.setDescription(movie.getDescription());
        movieDto.setActors(movie.getActors());
        movieDto.setGenres(movie.getGenres());
        movieDto.setImageUrl(movie.getImageUrl());
@@ -35,6 +36,7 @@ public class MovieMapper {
        Movie movie = new Movie();
        movie.setName(movieDto.name());
        movie.setDirector(movieDto.director());
        movie.setDescription(movieDto.description());
        movie.setActors(movieDto.actors());
        movie.setGenres(movieDto.genres());
        movie.setImageUrl(movieDto.imageUrl());
@@ -52,6 +54,7 @@ public class MovieMapper {
        movie.setId(movieDto.getId());
        movie.setName(movieDto.getName());
        movie.setDirector(movieDto.getDirector());
        movie.setDescription(movieDto.getDescription());
        movie.setActors(movieDto.getActors());
        movie.setGenres(movieDto.getGenres());
        movie.setImageUrl(movieDto.getImageUrl());
+29 −8
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ public class Movie {
    private Long id;
    private String name;
    private String director;
    private String description;
    private List<String> actors;
    private Collection<MovieGenre> genres;
    private String imageUrl;
@@ -22,15 +23,17 @@ public class Movie {
     * @param id          The identifier of the movie.
     * @param name        The name of the movie.
     * @param director    The director of the movie.
     * @param description The description of the movie.
     * @param genres      The genres of the movie.
     * @param actors      The actors of the movie.
     * @param imageUrl    The URL of the image of the movie.
     */
    public Movie(final Long id, final String name, final String director, final Collection<MovieGenre> genres,
                 final List<String> actors, final String imageUrl) {
    public Movie(final Long id, final String name, final String director, final String description,
                 final Collection<MovieGenre> genres, final List<String> actors, final String imageUrl) {
        this.id = id;
        this.name = name;
        this.director = director;
        this.description = description;
        this.genres = genres;
        this.actors = actors;
        this.imageUrl = imageUrl;
@@ -97,6 +100,24 @@ public class Movie {
        this.director = director;
    }

    /**
     * Gets the description of the movie.
     *
     * @return the description of the movie
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the description of the movie.
     *
     * @param description the description of the movie
     */
    public void setDescription(final String description) {
        this.description = description;
    }

    /**
     * Gets the actors of the movie.
     *