package com.mortals.xhx.module.news.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.news.model.vo.NewsVo;
import lombok.Data;
/**
 * 新闻实体对象
 *
 * @author zxfei
 * @date 2023-09-28
 */
@Data
public class NewsEntity extends NewsVo {
    private static final long serialVersionUID = 1L;

    /**
     * 分类id
     */
    private Long categoryId;
    /**
     * 分类名称
     */
    private String categoryName;
    /**
     * 标题
     */
    private String title;
    /**
     * 标题logo
     */
    private String titleLogoPath;
    /**
     * 内容
     */
    private String content;
    /**
     * 置顶 (0.否，1.是)
     */
    private Integer top;
    /**
     * 浏览次数
     */
    private Integer viewNums;
    /**
     * 发布时间
     */
    private Date publishTime;
    /**
     * 责任编辑
     */
    private String editor;
    /**
     * 分享次数
     */
    private Integer shareNums;
    /**
     * 发布部门
     */
    private Long deptId;
    /**
     * 所属部门名称
     */
    private String deptName;
    /**
     * 声明
     */
    private String statement;
    /**
     * 文章来源
     */
    private String source;
    /**
     * 备注
     */
    private String remark;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof NewsEntity) {
            NewsEntity tmp = (NewsEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
        this.categoryId = null;
        this.categoryName = "";
        this.title = "";
        this.titleLogoPath = "";
        this.content = "";
        this.top = 0;
        this.viewNums = 0;
        this.publishTime =null;
        this.editor = "";
        this.shareNums = 0;
        this.deptId = null;
        this.deptName = "";
        this.statement = "";
        this.source = "";
        this.remark = "";
    }
}