From d710d5856ffd022c0269da45ddc87b7ad394cf7a Mon Sep 17 00:00:00 2001 From: Philipp <26636274+PhilippFr@users.noreply.github.com> Date: Fri, 4 Nov 2022 12:45:47 +0100 Subject: [PATCH] feat: additional fields for SendMessageDto --- services/rocketchat.yaml | 28 ++++++++++++++++++- .../api/facade/UploadFacade.java | 4 ++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/services/rocketchat.yaml b/services/rocketchat.yaml index ed0db25..120544d 100644 --- a/services/rocketchat.yaml +++ b/services/rocketchat.yaml @@ -170,4 +170,30 @@ components: attachments: type: array items: - $ref: '#/components/schemas/Attachment' \ No newline at end of file + $ref: '#/components/schemas/Attachment' + file: + type: object + properties: + _id: + type: string + example: pw6oyrjBStWwMdeMv + name: + type: string + example: example.txt + type: + type: string + example: text/plain + files: + type: array + items: + type: object + properties: + _id: + type: string + example: pw6oyrjBStWwMdeMv + name: + type: string + example: example.txt + type: + type: string + example: text/plain \ No newline at end of file diff --git a/src/main/java/de/caritas/cob/uploadservice/api/facade/UploadFacade.java b/src/main/java/de/caritas/cob/uploadservice/api/facade/UploadFacade.java index be18231..0250f65 100644 --- a/src/main/java/de/caritas/cob/uploadservice/api/facade/UploadFacade.java +++ b/src/main/java/de/caritas/cob/uploadservice/api/facade/UploadFacade.java @@ -148,7 +148,7 @@ private void sanitizeAndEncryptParametersAndUploadToRocketChatRoom( log.debug("Upload Response: {}", uploadResponse); - if (doAttachmentE2e || true) { + if (doAttachmentE2e) { // TEMP DEV TryCatch TODO: REMOVE try { if (rocketChatService.deleteMessage(rocketChatCredentials, @@ -161,6 +161,8 @@ private void sanitizeAndEncryptParametersAndUploadToRocketChatRoom( .alias(uploadResponse.getMessage().getAlias()) .org(uploadResponse.getMessage().getOrg()) .t("e2e") + .file(uploadResponse.getMessage().getFile()) + .files(uploadResponse.getMessage().getFiles()) .attachments(uploadResponse.getMessage().getAttachments()) .build(); SendMessageResponseDTO postResponse = rocketChatService.sendGroupMessage(