package org.xyzh.crontab.task.newsTask;

import java.util.List;

import org.xyzh.common.dto.resource.TbResource;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description    爬虫返回文章结构
 * @filename    ArticleStruct.java
 * @author    yslg
 * @copyright xyzh
 * @since 2025-11-10
 */
@Data
@NoArgsConstructor
public class ArticleStruct {
    
    private String title;
    private String url;
    private String publishTime;
    private String author;
    private String source;
    private String logId;
    private Integer executeStatus;
    private String executeMessage;
    private List<RowStruct> contentRows;

    @Data
    @NoArgsConstructor
    public class RowStruct {
        // private String tag;
        // private String style;  // ttext-indent: 2em;->\t\t
        private String content; // 完整携带样式的p标签
    }

    public TbResource toTbResource(){
        TbResource tbResource = new TbResource();
        tbResource.setTitle(this.title);
        // tbResource.setUrl(this.url);
        // tbResource.setPublishTime(this.publishTime);
        // tbResource.setAuthor(this.author);
        // tbResource.setSource(this.source);
        // tbResource.setContentRows(this.contentRows);
        return tbResource;
    }
}
