-
Notifications
You must be signed in to change notification settings - Fork 0
Sprint 10. Controllers films users #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Checkstyle
Checkstyle
Checkstyle
| private void validateReleaseDate(Film film) { | ||
| log.debug("validateReleaseDate start for {}", film); | ||
| LocalDate birthdayFilm = LocalDate.of(1895, 12, 28); | ||
| if (film.getReleaseDate() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
у фильма может не быть описания (это ведь кто-то должен его написать), но вот отсутствие даты выпуска уже повод бросить исключение. Можно это реализовать здесь или в классе Film через аннотацию @NotNull
| } | ||
| } | ||
|
|
||
| private void validateCloneName(Film film) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
спорная проверка, в Задании нет требований, чтобы наименование фильма было уникальным, да и в жизни не мало фильмов с одинаковым названием
| log.debug("POST, create user {}", user); | ||
| cloneSearchEmail(user); | ||
| user.setId(getNextId()); | ||
| if (user.getName() == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
эта логика нужна и в методе update(), поэтому лучше вынести в отдельный внутренний метод и переиспользовать
| private String description; | ||
| private LocalDate releaseDate; | ||
| @Positive | ||
| private Integer duration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
для этого поля еще нужна аннотация @NotNull с комментарием
| private String login; | ||
| private String name; | ||
| @Past | ||
| private LocalDate birthday; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
и сюда тоже
No description provided.