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_app_link")
@Data
@EqualsAndHashCode(callSuper = true)
public class PortalAppLink extends BaseEntity {

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

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

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

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

    @TableField("link_icon_file_id")
    @ChineseDescription("链接图标的文件id")
    @SimpleFieldFormat(processClass = FileUrlFormatProcess.class)
    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;

}