2024-08-07 11:18:41 +01:00
|
|
|
import { MessageInputDTO } from "../../data/dto/message/messageInputDtO";
|
|
|
|
|
import { MessageOutPutDataDTO } from "../../data/dto/message/messageOutputDTO";
|
|
|
|
|
import { MessageEntity } from "../entity/message";
|
2024-08-09 10:50:32 +01:00
|
|
|
import { attachments } from '../../../../../../../../../Downloads/equilibriumito-gabinete-digital-fo-23cf0fc4cbaa/equilibriumito-gabinete-digital-fo-23cf0fc4cbaa/src/app/models/beast-orm';
|
2024-08-07 11:18:41 +01:00
|
|
|
|
|
|
|
|
export class MessageMapper {
|
|
|
|
|
static toDomain(DTO: MessageOutPutDataDTO) : MessageEntity {
|
|
|
|
|
return DTO as MessageEntity
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static fromDomain(entity:MessageEntity, requestId): MessageInputDTO {
|
|
|
|
|
return{
|
|
|
|
|
canEdit: entity.canEdit,
|
|
|
|
|
message: entity.message,
|
|
|
|
|
messageType: entity.messageType,
|
|
|
|
|
oneShot: entity.oneShot,
|
|
|
|
|
requireUnlock: entity.requireUnlock,
|
|
|
|
|
roomId: entity.roomId,
|
|
|
|
|
senderId: entity.sender.wxUserId,
|
2024-08-09 10:50:32 +01:00
|
|
|
requestId: requestId,
|
2024-08-13 10:52:35 +01:00
|
|
|
attachment: entity.attachments[0]
|
2024-08-07 11:18:41 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|