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

import cn.reghao.tnb.search.app.blog.model.po.Article;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author reghao
 * @date 2023-04-13 17:17:37
 */
@NoArgsConstructor
@Getter
public class EditArticle {
    private String articleId;
    private String title;
    private String content;
    private String editor;
    private Integer categoryId;
    private List<String> tags;
    private String published;

    public EditArticle(Article article, List<String> tags) {
        this.articleId = article.getArticleId();
        this.title = article.getTitle();
        this.content = article.getContent();
        this.editor = article.getEditor();
        this.categoryId = article.getCategoryId();
        this.tags = tags;
        this.published = article.getPublished() ? "1" : "0";
    }
}
