This commit is contained in:
2026-10-17 08:59:12 +03:00
parent 95aed3c25b
commit 7ffebe65d0
52 changed files with 1315 additions and 204 deletions
@@ -4,6 +4,7 @@ import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;
import ru.mtusi.messenger.dto.ChatDTO;
import ru.mtusi.messenger.dto.CreateChatDTO;
import ru.mtusi.messenger.model.Chat;
import ru.mtusi.messenger.model.User;
@@ -19,7 +20,7 @@ public interface ChatMapper {
@Mapping(target = "createdAt", ignore = true)
@Mapping(target = "members", ignore = true)
@Mapping(target = "messages", ignore = true)
Chat toChat(ChatDTO dto);
Chat toChat(CreateChatDTO dto);
@Mapping(target = "memberIds", source = "members", qualifiedByName = "usersToIds")
ChatDTO toChatDto(Chat chat);
@@ -2,6 +2,7 @@ package ru.mtusi.messenger.mapper;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import ru.mtusi.messenger.dto.CreateUserDTO;
import ru.mtusi.messenger.dto.UserDTO;
import ru.mtusi.messenger.model.User;
@@ -13,8 +14,7 @@ public interface UserMapper {
@Mapping(target = "passwordHash", ignore = true)
@Mapping(target = "chats", ignore = true)
@Mapping(target = "messages", ignore = true)
User toUser(UserDTO dto);
@Mapping(target = "password", ignore = true)
User toUser(CreateUserDTO dto);
UserDTO toUserDto(User user);
}