ЛР6: наблюдаемость, SLO и диагностика отказов
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package ru.mtusi.messenger.mapper;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import ru.mtusi.messenger.dto.CreateMessageDTO;
|
||||
import ru.mtusi.messenger.dto.MessageDTO;
|
||||
import ru.mtusi.messenger.model.Message;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MessageMapper {
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "chat", ignore = true)
|
||||
@Mapping(target = "sender", ignore = true)
|
||||
@Mapping(target = "createdAt", ignore = true)
|
||||
@Mapping(target = "attachmentIds", ignore = true)
|
||||
Message toMessage(MessageDTO dto);
|
||||
|
||||
@Mapping(target = "chatId", source = "chat.id")
|
||||
@Mapping(target = "senderId", source = "sender.id")
|
||||
@Mapping(target = "attachmentIds", source = "attachmentIds")
|
||||
MessageDTO toMessageDTO(Message entity);
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "chat", ignore = true)
|
||||
@Mapping(target = "sender", ignore = true)
|
||||
@Mapping(target = "createdAt", ignore = true)
|
||||
@Mapping(target = "attachmentIds", source = "attachmentIds")
|
||||
Message toMessage(CreateMessageDTO dto);
|
||||
}
|
||||
Reference in New Issue
Block a user