ShoppingCrawler/sender/src/main/java/com/myoa/engineering/crawl/ppomppu/sender/dto/SlackSectionMessageBlock.java

41 lines
1.1 KiB
Java
Raw Normal View History

2021-11-30 16:16:01 +00:00
package com.myoa.engineering.crawl.ppomppu.sender.dto;
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)
2021-11-30 16:16:15 +00:00
public class SlackSectionMessageBlock implements SlackMessageBlock {
2021-11-30 16:16:01 +00:00
private static final long serialVersionUID = -7600944576753160168L;
private SlackMessageBlockType type;
2021-11-30 16:16:15 +00:00
private SlackBaseMessageBlock text;
2021-11-30 16:16:01 +00:00
@Builder
2021-11-30 16:16:15 +00:00
private SlackSectionMessageBlock(SlackMessageBlockType type, SlackBaseMessageBlock text) {
2021-11-30 16:16:01 +00:00
this.type = type;
this.text = text;
}
2021-11-30 16:16:15 +00:00
public static SlackSectionMessageBlock ofMarkDown(String message) {
return SlackSectionMessageBlock.builder()
.type(SlackMessageBlockType.SECTION)
.text(SlackBaseMessageBlock.ofMarkDown(message))
.build();
2021-11-30 16:16:01 +00:00
}
public String getType() {
return type.getType();
}
}