package com.fs.hisStore.domain;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fs.common.annotation.Excel;
import com.fs.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 期刊对象 fs_home_article
 *
 * @author fs
 * @date 2025-05-22
 */
@Setter
@Getter
@TableName("fs_home_article")
public class FsHomeArticleScrm extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    @ApiModelProperty(value = "页码,默认为1")
    private Integer pageNum = 1;

    @TableField(exist = false)
    @ApiModelProperty(value = "页大小,默认为10")
    private Integer pageSize = 10;

    /** ID */
    private Long articleId;

    /** 分类ID */
    @Excel(name = "分类ID")
    private Long categoryId;

    /** 标题 */
    @Excel(name = "标题")
    private String title;

    /** 封面图片 */
    @Excel(name = "封面图片")
    private String imageUrl;

    /** 是否推荐 */
    @Excel(name = "是否推荐")
    private Integer isTui;

    /** 视频地址 */
    @Excel(name = "视频地址")
    private String videoUrl;

    /** 内容 */
    @Excel(name = "内容")
    private String content;

    /** 浏览数 */
    @Excel(name = "浏览数")
    private Integer views;

    /** 排序 */
    @Excel(name = "排序")
    private Integer sort;

    /** 发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField(strategy= FieldStrategy.IGNORED)
    private Date publishTime;

    /** 发布状态：1-已发布；2-草稿 */
    @Excel(name = "发布状态：1-已发布；2-草稿")
    private Integer publicStatus;

    /** 描述 */
    @Excel(name = "描述")
    private String description;

    @TableField(exist = false)
    @Excel(name = "分类名称")
    private String categoryName;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("articleId", getArticleId())
            .append("categoryId", getCategoryId())
            .append("title", getTitle())
            .append("imageUrl", getImageUrl())
            .append("isTui", getIsTui())
            .append("videoUrl", getVideoUrl())
            .append("content", getContent())
            .append("views", getViews())
            .append("sort", getSort())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("publishTime", getPublishTime())
            .append("publicStatus", getPublicStatus())
            .toString();
    }
}
