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

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@TableName(value = "portal_design", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class PortalDesign extends BaseEntity {

    @TableId(value = "design_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("门户设计id")
    private Long designId;

    @TableField("design_name")
    @ChineseDescription("门户设计名称")
    private String designName;

    @TableField("design_logo")
    @ChineseDescription("封面图logo，存前端图标的编码")
    private String designLogo;

    @TableField("description")
    @ChineseDescription("描述")
    private String description;

    @TableField("design_status")
    @ChineseDescription("门户设计的状态：10-启用，20-下架")
    private Integer designStatus;

    @TableField(value = "design_layout_json", typeHandler = JacksonTypeHandler.class)
    @ChineseDescription("门户拖拽设计的布局，json结构")
    private JSONObject designLayoutJson;

    @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;

}