-
Notifications
You must be signed in to change notification settings - Fork 0
add-database. Добавить базу данных для сохранения сущностей. #3
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
| @RestController | ||
| @RequestMapping(value = "/genres") | ||
| @RequiredArgsConstructor | ||
| public class GenreController { |
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.
добавь логи в методы
| @RestController | ||
| @RequestMapping(value = "/mpa") | ||
| @RequiredArgsConstructor | ||
| public class RatingMPAController { |
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 Genre getById(Long id) { | ||
| if (storage.getById(id) == 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.
метод storage.getById() сам бросит исключение, если жанр не найден
| } | ||
|
|
||
| public RatingMPA getById(Long id) { | ||
| if (storage.getById(id) == 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.
запиши результат storage.getById() в переменную, чтобы не запрашивать еще раз из БД
|
|
||
| public void addOrUpdateUser(User user); | ||
| public void createUser(User user); | ||
|
|
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 и явное указание это модификатора уже выглядит "маслом масляным"))
…ненужный код при запросе жанров и рейтинга по id. Удалить модификаторы public в интерфейсах
No description provided.