diff --git a/processor-1.0.1.jar b/processor-1.0.1.jar deleted file mode 100644 index 448df79..0000000 Binary files a/processor-1.0.1.jar and /dev/null differ diff --git a/receiver-1.0.1.jar b/receiver-1.0.1.jar deleted file mode 100644 index cc03e1a..0000000 Binary files a/receiver-1.0.1.jar and /dev/null differ diff --git a/sender-1.0.1.jar b/sender-1.0.1.jar deleted file mode 100644 index ff87444..0000000 Binary files a/sender-1.0.1.jar and /dev/null differ diff --git a/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackBaseMessageBlock.java b/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackBaseMessageBlock.java new file mode 100644 index 0000000..44e72e7 --- /dev/null +++ b/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackBaseMessageBlock.java @@ -0,0 +1,48 @@ +package com.myoa.engineering.crawl.ppomppu.sender.dto; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonInclude; + +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * MessageBlock + * @author Shin Woo-jin (woo-jin.shin@linecorp.com) + * @since 2021-11-30 + * + */ +@Getter +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class SlackMessageBlock implements Serializable { + private static final long serialVersionUID = 1597984001727808419L; + + private SlackMessageBlockType type; + private String text; + + @Builder + private SlackMessageBlock(SlackMessageBlockType type, String text) { + this.type = type; + this.text = text; + } + + public static SlackMessageBlock ofMarkDown(String message) { + return SlackMessageBlock.builder() + .type(SlackMessageBlockType.MARKDOWN) + .text(message) + .build(); + } + + public static SlackMessageBlock ofDivider() { + return SlackMessageBlock.builder() + .type(SlackMessageBlockType.DIVIDER) + .build(); + } + + public String getType() { + return type.getType(); + } +} diff --git a/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackMessageBlock.java b/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackMessageBlock.java new file mode 100644 index 0000000..796bc01 --- /dev/null +++ b/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackMessageBlock.java @@ -0,0 +1,8 @@ +package com.myoa.engineering.crawl.ppomppu.sender.dto;/** + * SlackMessageBlock + * @author Shin Woo-jin (woo-jin.shin@linecorp.com) + * @since 2021-12-01 + * + */ + public interface SlackMessageBlock { +} diff --git a/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackMessageBlockType.java b/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackMessageBlockType.java new file mode 100644 index 0000000..272fd1f --- /dev/null +++ b/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackMessageBlockType.java @@ -0,0 +1,21 @@ +package com.myoa.engineering.crawl.ppomppu.sender.dto; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * BlockType + * @author Shin Woo-jin (woo-jin.shin@linecorp.com) + * @since 2021-11-30 + * + */ +@Getter +@AllArgsConstructor +public enum BlockType { + SECTION("section"), + MARKDOWN("mrkdwn"), + DIVIDER("divider"), + ; + + private String type; +} diff --git a/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackSectionMessageBlock.java b/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackSectionMessageBlock.java new file mode 100644 index 0000000..98a107d --- /dev/null +++ b/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackSectionMessageBlock.java @@ -0,0 +1,49 @@ +package com.myoa.engineering.crawl.ppomppu.sender.dto; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonInclude; + +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * SectionBlock + * @author Shin Woo-jin (woo-jin.shin@linecorp.com) + * @since 2021-11-30 + * + */ +@Getter +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class SlackSectionBlock implements Serializable { + private static final long serialVersionUID = -7600944576753160168L; + + private SlackMessageBlockType type; + private SlackMessageBlock text; + + @Builder + private SlackSectionBlock(SlackMessageBlockType type, SlackMessageBlock text) { + this.type = type; + this.text = text; + } + + public static SlackSectionBlock ofMarkDown(String message) { + return SlackSectionBlock.builder() + .type(SlackMessageBlockType.SECTION) + .text(SlackMessageBlock.ofMarkDown(message)) + .build(); + } + + public static SlackSectionBlock ofDivider() { + return SlackSectionBlock.builder() + .type(SlackMessageBlockType.SECTION) + .text(SlackMessageBlock.ofDivider()) + .build(); + } + + public String getType() { + return type.getType(); + } +} diff --git a/support/src/main/java/com/myoa/engineering/crawl/ppomppu/support/dto/BlockMessageDTO.java b/support/src/main/java/com/myoa/engineering/crawl/ppomppu/support/dto/BlockMessageDTO.java new file mode 100644 index 0000000..1a2c026 --- /dev/null +++ b/support/src/main/java/com/myoa/engineering/crawl/ppomppu/support/dto/BlockMessageDTO.java @@ -0,0 +1,37 @@ + package com.myoa.engineering.crawl.ppomppu.support.dto; + +import java.io.Serializable; +import java.time.Instant; + +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * SimpleMessageDTO + * @author Shin Woo-jin (woo-jin.shin@linecorp.com) + * @since 2021-11-21 + * + */ +@Getter +@NoArgsConstructor +public class SimpleMessageDTO implements Serializable { + + private static final long serialVersionUID = 2203955567672404428L; + + private String title; + private String body; + private String url; + private Instant publishedAt; + private Instant requestedAt; + + @Builder + public SimpleMessageDTO(String title, String body, String url, Instant publishedAt, Instant requestedAt) { + this.title = title; + this.body = body; + this.url = url; + this.publishedAt = publishedAt; + this.requestedAt = requestedAt; + } + +}