Skip to content

Add database#7

Open
GrettaSmith wants to merge 20 commits intomainfrom
add-database
Open

Add database#7
GrettaSmith wants to merge 20 commits intomainfrom
add-database

Conversation

@GrettaSmith
Copy link
Owner

No description provided.

public class Film {

Integer id;
private Integer id;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо множественных private лучше использовать FieldDefaults

@@ -16,19 +14,20 @@
@Builder
@AllArgsConstructor
@ValidateOnExecution

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Валидировать лучше в слое контроллеров

Film film = filmStorage.getFilmById(id);
if (!film.getUserLikes().contains(userId)) {
throw new NotFoundException("Film not found!");
throw new NotFoundException("User not found!");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Указывай id в комментариях пользователю

protected final Set<Film> filmsRating = new TreeSet<>(likesComparator);

private final HashMap<Integer, Film> filmsList = new HashMap<>();
private int id = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не обязательно инициализироаать примитивный дефолтными значениями

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants