package cn.reghao.tnb.search.app.comment.model.vo;

import cn.reghao.jutil.jdk.converter.DateTimeConverter;
import cn.reghao.tnb.search.app.comment.model.po.RichText;
import lombok.Getter;
import lombok.Setter;

/**
 * @author reghao
 * @date 2025-07-29 13:55:57
 */
@Setter
@Getter
public class NewsPost {
    private long contentId;
    private String title;
    private String coverUrl;
    private String content;
    private String publishAt;
    private String originalUrl;

    public NewsPost(RichText richText) {
        this.contentId = richText.getContentId();
        this.title = richText.getTitle();
        this.coverUrl = richText.getCoverUrl();
        this.content = richText.getContent();
        this.publishAt = DateTimeConverter.format(richText.getPublishAt());
        this.originalUrl = richText.getOriginalUrl();
    }
}
