diff --git a/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/BoxAnswer.java b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/BoxAnswer.java index d0ab002..ea813fc 100644 --- a/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/BoxAnswer.java +++ b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/BoxAnswer.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import dev.struchkov.godfather.main.domain.jackson.TelegramPayloadDeserializer; import dev.struchkov.godfather.main.domain.jackson.TelegramPayloadSerializer; import dev.struchkov.godfather.main.domain.keyboard.KeyBoard; +import dev.struchkov.godfather.quarkus.domain.content.send.SendAttachment; import dev.struchkov.haiti.utils.container.ContextKey; import io.smallrye.mutiny.Uni; import lombok.Getter; @@ -60,6 +61,8 @@ public class BoxAnswer { @JsonDeserialize(using = TelegramPayloadDeserializer.class) protected Map payload = new HashMap<>(); + private SendAttachment attachment; + private BoxAnswer(Builder builder) { message = builder.message; keyBoard = builder.keyBoard; @@ -67,6 +70,7 @@ public class BoxAnswer { replaceMessageId = builder.replaceMessageId; recipientPersonId = builder.recipientPersonId; payload = builder.payload; + attachment = builder.attachment; } public static BoxAnswer boxAnswer(boolean replace, String message) { @@ -149,6 +153,7 @@ public class BoxAnswer { private String replaceMessageId; private String recipientPersonId; private Map payload = new HashMap<>(); + private SendAttachment attachment; private Builder() { } @@ -192,6 +197,14 @@ public class BoxAnswer { return this; } + public Builder attachment(SendAttachment attachment) { + if (checkNotNull(attachment)) { + this.attachment = attachment; + } + return this; + } + + public BoxAnswer build() { return new BoxAnswer(this); } diff --git a/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/content/send/SendAttachment.java b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/content/send/SendAttachment.java new file mode 100644 index 0000000..95e3bbc --- /dev/null +++ b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/content/send/SendAttachment.java @@ -0,0 +1,9 @@ +package dev.struchkov.godfather.quarkus.domain.content.send; + +public interface SendAttachment { + + String getType(); + + SendFile getSendFile(); + +} diff --git a/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/content/send/SendFile.java b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/content/send/SendFile.java new file mode 100644 index 0000000..3851d83 --- /dev/null +++ b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/content/send/SendFile.java @@ -0,0 +1,30 @@ +package dev.struchkov.godfather.quarkus.domain.content.send; + +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.io.File; +import java.io.InputStream; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public class SendFile { + + private String fileId; + + private String url; + + private String fileName; + + private File data; + + private InputStream fileStream; + +}