Skip to content

Conversation

@walder86
Copy link
Owner

Добавить хранилища. Добавить сервисы.

@walder86 walder86 force-pushed the add-friends-likes branch 3 times, most recently from f2264e6 to e1af25c Compare June 16, 2025 05:48
@walder86 walder86 force-pushed the add-friends-likes branch from e1af25c to e0a8915 Compare June 16, 2025 06:08
import java.util.Map;
import java.util.List;

@Slf4j

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

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 {

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

Choose a reason for hiding this comment

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

добавь логи в те методы, где их нет

}
}

public List<Film> getPopularFilms(Long count) {

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

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

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

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 {

Choose a reason for hiding this comment

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

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

@walder86 walder86 force-pushed the add-friends-likes branch from c9b2034 to a5ce0bb Compare June 16, 2025 14:34
@walder86 walder86 merged commit 7c971db into main Jun 17, 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