package cn.stylefeng.team.portal.modular.management.entity;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.file.api.format.FileUrlFormatProcess;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.annotation.SimpleFieldFormat;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@TableName("portal_slideshow")
@Data
@EqualsAndHashCode(callSuper = true)
public class PortalSlideshow extends BaseEntity {

    @TableId(value = "slideshow_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("轮播图id")
    private Long slideshowId;

    @TableField("design_id")
    @ChineseDescription("门户设计id")
    private Long designId;

    @TableField("slideshow_title")
    @ChineseDescription("轮播图标题")
    private String slideshowTitle;

    @TableField("slideshow_cover_file_id")
    @ChineseDescription("轮播图文件id")
    @SimpleFieldFormat(processClass = FileUrlFormatProcess.class)
    private Long slideshowCoverFileId;

    @TableField("slideshow_redirect_type")
    @ChineseDescription("轮播图跳转类型：5-无跳转，10-跳转到新闻，20-跳转到指定URL")
    private Integer slideshowRedirectType;

    @TableField("slideshow_news_id")
    @ChineseDescription("轮播图关联的新闻文章id")
    private Long slideshowNewsId;

    @TableField("slideshow_redirect_url")
    @ChineseDescription("轮播图外部URL地址")
    private String slideshowRedirectUrl;

    @TableField("fld_sort")
    @ChineseDescription("轮播图排序")
    private BigDecimal fldSort;

    @TableField(value = "version_flag", fill = FieldFill.INSERT)
    @ChineseDescription("乐观锁")
    @Version
    private Long versionFlag;

    @TableField(value = "del_flag", fill = FieldFill.INSERT)
    @ChineseDescription("是否删除：Y-删除，N-未删除")
    @TableLogic
    private String delFlag;

    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    @ChineseDescription("租户id")
    private Long tenantId;

    @TableField(exist = false)
    @ChineseDescription("新闻标题")
    private String slideshowNewsTitle;

}