69 lines
1.8 KiB
Java
69 lines
1.8 KiB
Java
package com.myoa.engineering.crawl.ppomppu.support.dto;
|
|
|
|
import java.io.Serializable;
|
|
import java.time.Instant;
|
|
import java.util.List;
|
|
|
|
import com.myoa.engineering.crawl.ppomppu.support.dto.code.PpomppuBoardName;
|
|
|
|
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 BlockMessageDTO implements Serializable {
|
|
|
|
private static final long serialVersionUID = -6992039884035135523L;
|
|
|
|
private PpomppuBoardName boardName;
|
|
private String title;
|
|
private List<Block> blocks;
|
|
private String url;
|
|
private Instant publishedAt;
|
|
private Instant requestedAt;
|
|
|
|
@Builder
|
|
public BlockMessageDTO(PpomppuBoardName boardName, String title,
|
|
List<Block> blocks, String url, Instant publishedAt,
|
|
Instant requestedAt) {
|
|
this.boardName = boardName;
|
|
this.title = title;
|
|
this.blocks = blocks;
|
|
this.url = url;
|
|
this.publishedAt = publishedAt;
|
|
this.requestedAt = requestedAt;
|
|
}
|
|
|
|
@Getter
|
|
@NoArgsConstructor
|
|
public static class Block implements Serializable {
|
|
private static final long serialVersionUID = 3633781631892663709L;
|
|
|
|
private String text;
|
|
private String imageUrl;
|
|
private String altText;
|
|
|
|
public Block(String text, String imageUrl, String altText) {
|
|
this.text = text;
|
|
this.imageUrl = imageUrl;
|
|
this.altText = altText;
|
|
}
|
|
}
|
|
|
|
public static Block createBlock(String text, String imageUrl) {
|
|
return new Block(text, imageUrl, "");
|
|
}
|
|
|
|
public static Block createBlock(String text, String imageUrl, String altText) {
|
|
return new Block(text, imageUrl, altText);
|
|
}
|
|
|
|
}
|