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.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@TableName("portal_common_app_link")
@Data
@EqualsAndHashCode(callSuper = true)
public class CommonAppLink extends BaseEntity {

    @TableId(value = "app_link_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键id")
    private Long appLinkId;

    @TableField("link_category_id")
    @ChineseDescription("所属链接分类id")
    private Long linkCategoryId;

    @TableField("link_name")
    @ChineseDescription("链接名称")
    private String linkName;

    @TableField("icon_type")
    @ChineseDescription("图标类型：1-文件id，2-选择图片")
    private Integer iconType;

    @TableField("icon_code")
    @ChineseDescription("图标编码")
    private String iconCode;

    @TableField("link_icon_file_id")
    @ChineseDescription("链接图标的文件id")
    private Long linkIconFileId;

    @TableField("redirect_type")
    @ChineseDescription("跳转方式：1-内部路由，2-外部链接")
    private Integer redirectType;

    @TableField("redirect_url")
    @ChineseDescription("跳转路由")
    private String redirectUrl;

    @TableField("open_type")
    @ChineseDescription("打开方式：1-本页面打开，2-新标签打开")
    private Integer openType;

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

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

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

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

    @TableField(exist = false)
    @ChineseDescription("应用链接分类的名称")
    private String linkCategoryName;

}