Skip to content

Commit

Permalink
refactor mappers files
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Nov 6, 2024
1 parent 8a4ac51 commit 76933a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/chat/yourway/mapper/MessageMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@Mapper(componentModel = "spring", uses = BaseMessageMapper.class)
public interface MessageMapper {
@Mapping(target = "topicId", source = "topic.id")
@Mapping(target = "my", source = ".", qualifiedByName = {"BaseMessageMapper", "isMyMessage"})
@Mapping(target = "my", source = "message", qualifiedByName = {"BaseMessageMapper", "isMyMessage"})
MessageResponseDto toResponseDto(Message message, @Context Contact me);
@Mapping(target = "topicId", source = "topic.id")
@Mapping(target = "my", source = "content")
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/chat/yourway/mapper/TopicMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@

@Mapper(componentModel = "spring", uses = BaseMapper.class)
public interface TopicMapper {
@Mapping(target = "unreadMessages", source = ".", qualifiedByName = {"BaseMapper", "getUnreadMessages"})
@Mapping(target = "lastMessage", source = ".", qualifiedByName = {"BaseMapper", "getLastMessage"})
@Mapping(target = "unreadMessages", source = "topic", qualifiedByName = {"BaseMapper", "getUnreadMessages"})
@Mapping(target = "lastMessage", source = "topic", qualifiedByName = {"BaseMapper", "getLastMessage"})
TopicResponseDto toResponseDto(Topic topic, @Context Contact me);
@Mapping(target = "name", source = ".", qualifiedByName = {"BaseMapper", "getNamePrivateTopic"})
@Mapping(target = "contact", source = ".", qualifiedByName = {"BaseMapper", "getContactPrivateTopic"})
@Mapping(target = "unreadMessages", source = ".", qualifiedByName = {"BaseMapper", "getUnreadMessages"})
@Mapping(target = "lastMessage", source = ".", qualifiedByName = {"BaseMapper", "getLastMessage"})
@Mapping(target = "name", source = "topic", qualifiedByName = {"BaseMapper", "getNamePrivateTopic"})
@Mapping(target = "contact", source = "topic", qualifiedByName = {"BaseMapper", "getContactPrivateTopic"})
@Mapping(target = "unreadMessages", source = "topic", qualifiedByName = {"BaseMapper", "getUnreadMessages"})
@Mapping(target = "lastMessage", source = "topic", qualifiedByName = {"BaseMapper", "getLastMessage"})
PrivateTopicInfoResponseDto toInfoPrivateResponseDto(Topic topic, @Context Contact me);
@Mapping(target = "unreadMessages", source = ".", qualifiedByName = {"BaseMapper", "getUnreadMessages"})
@Mapping(target = "lastMessage", source = ".", qualifiedByName = {"BaseMapper", "getLastMessage"})
@Mapping(target = "unreadMessages", source = "topic", qualifiedByName = {"BaseMapper", "getUnreadMessages"})
@Mapping(target = "lastMessage", source = "topic", qualifiedByName = {"BaseMapper", "getLastMessage"})
PublicTopicInfoResponseDto toInfoPublicResponseDto(Topic topic, @Context Contact me);
List<PublicTopicInfoResponseDto> toListInfoResponseDto(List<Topic> topics, @Context Contact me);
}

0 comments on commit 76933a2

Please sign in to comment.