-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: fixed notification and event type * bugfix: fixed disconnect from websocket. Set time to first message. * fix: refactored and optimized notifications
- Loading branch information
Showing
16 changed files
with
153 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
src/main/java/com/chat/yourway/mapper/MessageNotificationMapper.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/main/java/com/chat/yourway/mapper/NotificationMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.chat.yourway.mapper; | ||
|
||
import com.chat.yourway.dto.response.MessageNotificationResponseDto; | ||
import com.chat.yourway.dto.response.TopicNotificationResponseDto; | ||
import com.chat.yourway.model.event.ContactEvent; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
|
||
@Mapper(componentModel = "spring") | ||
public interface NotificationMapper { | ||
|
||
@Mapping(target = "status", source = "eventType") | ||
@Mapping(target = "lastRead", source = "timestamp") | ||
@Mapping(target = "email", source = "email") | ||
MessageNotificationResponseDto toMessageNotificationResponseDto(ContactEvent event); | ||
|
||
@Mapping(target = "topicId", source = "topicId") | ||
@Mapping(target = "unreadMessages", source = "unreadMessages") | ||
@Mapping(target = "lastMessage", source = "lastMessage") | ||
TopicNotificationResponseDto toTopicNotificationResponseDto(ContactEvent event); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,7 +202,7 @@ void notifyTopicSubscribers_shouldNotifyTopicSubscribersIfSubscribeEvent() { | |
lastMessageDto.setSentFrom("[email protected]"); | ||
lastMessageDto.setLastMessage("Hi"); | ||
|
||
var event = new ContactEvent("[email protected]", topicId, ONLINE, LocalDateTime.now(), | ||
var event = new ContactEvent("[email protected]", topicId, ONLINE, LocalDateTime.now(), 0, | ||
lastMessageDto); | ||
saveContactEvent(event); | ||
//Stored subscription results for testing | ||
|
@@ -233,7 +233,7 @@ void notifyTopicSubscribers_shouldNotifyTopicSubscribersIfAnyContactSubscribedTo | |
lastMessageDto.setSentFrom("[email protected]"); | ||
lastMessageDto.setLastMessage("Hi"); | ||
|
||
var event = new ContactEvent("[email protected]", topicId, ONLINE, LocalDateTime.now(), | ||
var event = new ContactEvent("[email protected]", topicId, ONLINE, LocalDateTime.now(), 0, | ||
lastMessageDto); | ||
saveContactEvent(event); | ||
//Stored subscription results for testing | ||
|
Oops, something went wrong.