-
Notifications
You must be signed in to change notification settings - Fork 0
add-friends-likes. Добавить новые методы для лайков и друзей. #2
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
f2264e6 to
e1af25c
Compare
…ь хранилища. Добавить сервисы.
e1af25c to
e0a8915
Compare
| import java.util.Map; | ||
| import java.util.List; | ||
|
|
||
| @Slf4j |
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.
в этом классе больше нет логирования
| import java.util.Map; | ||
| import java.util.List; | ||
|
|
||
| @Slf4j |
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.
и в этом тоже
| import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
|
||
| @RestControllerAdvice | ||
| public class ExceptionHandlerClass { |
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.
убери из названия класса Class
| import java.time.LocalDate; | ||
| import java.util.List; | ||
|
|
||
| @Slf4j |
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.
добавь логи в те методы, где их нет
src/main/java/ru/yandex/practicum/filmorate/service/FilmService.java
Outdated
Show resolved
Hide resolved
| } | ||
| } | ||
|
|
||
| public List<Film> getPopularFilms(Long count) { |
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.
добавь проверку, что count больше нуля
| import java.time.LocalDate; | ||
| import java.util.List; | ||
|
|
||
| @Slf4j |
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.
добавь логи в те методы, где их нет
| } | ||
|
|
||
| public User getUserById(Long userId) { | ||
| User user = userStorage.getUserById(userId); |
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.info("Пользователь с id " + newUser.getId() + " обновлен"); | ||
| return oldUser; | ||
| } | ||
|
|
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.
для методов с друзьями вынеси из storage в сервис поверку существования пользователей
| import java.util.List; | ||
|
|
||
| public interface UserStorage { | ||
|
|
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.
в интерфейсах все методы по умолчанию являются public и явное указание это модификатора уже выглядит "маслом масляным"))
…ку из хранилищ в сервисы.
c9b2034 to
a5ce0bb
Compare
Добавить хранилища. Добавить сервисы.