Skip to content

Conversation

@walder86
Copy link
Owner

No description provided.

@RestController
@RequestMapping(value = "/genres")
@RequiredArgsConstructor
public class GenreController {

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 {

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) {

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) {

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);

Choose a reason for hiding this comment

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

в интерфейсах все методы по умолчанию являются public и явное указание это модификатора уже выглядит "маслом масляным"))

…ненужный код при запросе жанров и рейтинга по id. Удалить модификаторы public в интерфейсах
@walder86 walder86 merged commit 91d1541 into main Jun 26, 2025
2 checks passed
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.

3 participants