Skip to content

The logic of searching for valid users has been moved to the database#28

Merged
monkey-keeper merged 1 commit intomainfrom
tnews-25/fixDB
Mar 19, 2025
Merged

The logic of searching for valid users has been moved to the database#28
monkey-keeper merged 1 commit intomainfrom
tnews-25/fixDB

Conversation

@monkey-keeper
Copy link
Copy Markdown
Collaborator

No description provided.

@monkey-keeper monkey-keeper self-assigned this Mar 18, 2025
@SHVERR SHVERR requested review from AliKamil and SHVERR March 18, 2025 21:07
public void sendNewsDigest() {
log.info("Sending news digest");
List<Subscription> subscriptionList = subscriptionService.findAll();
List<Subscription> subscriptionList = subscriptionService.findNewsToValidSubscriptions();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Стало на порядок лучше.

Set<String> sendNews = new HashSet<>();

List<NewsDto> newNews = subscriptionService.getActualNews(chatId, 3); // userService.findActualNews(chatId);
List<NewsDto> newNews = subscriptionService.getActualNews(chatId, 3);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Это мы лимит хардкодим? Вынеси тогда в константу, чтобы читалось нормально.

@Getter
@AllArgsConstructor
public enum TimeInterval {
// при внесении изменений придется менять SubscriptionRepository, так как там используется ORDINAL
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Чтобы не забыть надо писать тесты, тогда они начнут падать если забудешь поменять. Все эти комментарии - бесполезны практически, ставь жесткие ограничения.

@monkey-keeper monkey-keeper merged commit fb3eff9 into main Mar 19, 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.

4 participants