[NO-ISSUE] Fix bug

This commit is contained in:
woo-jin.shin 2021-12-01 01:16:01 +09:00
parent 0524a18ee5
commit b204b70b79
8 changed files with 163 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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();
}
}

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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();
}
}

View File

@ -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;
}
}