Skip to content

sprint13/develop - #22

Merged
AleksOBM merged 60 commits into
mainfrom
develop
Feb 24, 2026
Merged

AleksOBM merged 60 commits into
mainfrom
develop

Conversation

@AleksOBM

Copy link
Copy Markdown
Owner

No description provided.

LyutovSergey and others added 30 commits February 17, 2026 12:41
…работу с этими событиями

# Conflicts:
#	src/main/java/ru/yandex/practicum/filmorate/dal/database/BaseDbStorage.java
#	src/main/resources/schema.sql
feat: Implement film recommendation system
Модернизация метода, который возвращает популярные фильмы.
Реализовать функции добавления и получения режиссера
         	@qualifier("filmDbStorage")
         	private FilmStorage filmStorage;
В UserService
…ильмов с сортировкой по их популярности

# Conflicts:
#	src/main/java/ru/yandex/practicum/filmorate/controller/FilmController.java
Darya346 and others added 22 commits February 20, 2026 20:29
В сущности Event поле id заменила на eventId
В метод getTopByFilters добавлен директор
""";
}
@GetMapping
public String homePage() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

вау))

);
}

public Collection<FilmDto> getCommonLikedFilms(Long userId, Long friendId) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

добавь проверку, что это не один и тот же пользователь

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Готово

log.info("Данные для обновления: [{}]", updatedData);
}

public Collection<FilmDto> search(String query, String by) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

добавь проверку, что query и by не null и не пустая строка

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Готово

public ReviewDto updateReview(ReviewUpdateRequest request) {
log.info("Обновление данных об отзыве с id={}", request.getReviewId());

Review oldReview = reviewStorage.findReviewById(request.getReviewId())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

вынеси поиск отзыва/проброс исключения в отдельный метод класса

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Готово

}
}

if (similarUserId == -1) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

рекомендации формируются не по одному пользователю. Нужно определить размуное (10-15) количество пользователей с кем лайки пересекаются. И уже у них собирать фильмы для рекомендации

Set<Long> similarUserLikes = allLikes.get(similarUserId);
return similarUserLikes.stream()
.filter(filmId -> !targetUserLikes.contains(filmId))
.map(filmService::findById)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

фильмы нужно получить за один запрос, а не в потоке по одному обращаться к БД

@AleksOBM
AleksOBM merged commit d20c9e7 into main Feb 24, 2026
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.

5 participants