Skip to content
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

mapping user email to nickname in MessageResponseDto #80

Merged
merged 1 commit into from
May 11, 2024

Conversation

Troha7
Copy link
Member

@Troha7 Troha7 commented May 9, 2024

No description provided.

@Troha7 Troha7 requested a review from LionnoiL May 9, 2024 20:56
Copy link
Contributor

@LionnoiL LionnoiL left a comment

Choose a reason for hiding this comment

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

немає додавання поля нікнейму в LastMessageResponseDto що повинно бути по завданню.

Comment on lines +55 to +58
messageResponseDto.setSentFrom(contactService.findByEmail(email).getNickname());
messageResponseDto.setSendTo(
contactService.findByEmail(messageResponseDto.getSendTo()).getNickname());

Copy link
Contributor

Choose a reason for hiding this comment

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

немає перевірки на exception. setSendTo в більшості випадків буде викликати ContactNotFoundException бо такого контакта як, наприклад, Topic id=4 немає.

Copy link
Member Author

Choose a reason for hiding this comment

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

Перевірка є
test3
Всі поля обєктів DTO валідуються та оброблюються в классі WebsocketExceptionHandler а потім виводится повідомлення про помилку від сервера

Copy link
Contributor

Choose a reason for hiding this comment

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

так. не побачив що це приватний у тебе топік.

@Troha7
Copy link
Member Author

Troha7 commented May 10, 2024

Можливо я щось не так зрозумів але наче нікнейм є в полі sentFrom
test1

Comment on lines +55 to +58
messageResponseDto.setSentFrom(contactService.findByEmail(email).getNickname());
messageResponseDto.setSendTo(
contactService.findByEmail(messageResponseDto.getSendTo()).getNickname());

Copy link
Contributor

Choose a reason for hiding this comment

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

так. не побачив що це приватний у тебе топік.

Comment on lines +70 to +73
List<MessageResponseDto> messages = messageService.findAllByTopicId(topicId, pageRequestDto)
.stream()
.peek(m -> m.setSentFrom(contactService.findByEmail(m.getSentFrom()).getNickname()))
.toList();
Copy link
Contributor

Choose a reason for hiding this comment

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

цей використовується тільки для публічних топіків?

Copy link
Member Author

Choose a reason for hiding this comment

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

Це для отримання історії переписки як публічних так і приватних топіків.

Copy link
Contributor

Choose a reason for hiding this comment

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

якщо і для приватних то не бачу setSentTo

Copy link
Member Author

Choose a reason for hiding this comment

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

Дякую я це не помітив)

@Troha7 Troha7 merged commit af0680b into develop May 11, 2024
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.

2 participants