package com.gxwebsoft.cms.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 导航
 *
 * @author 科技小王子
 * @since 2024-03-04 21:27:55
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Navigation对象", description = "导航")
@TableName("cms_navigation")
public class Navigation implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "navigation_id", type = IdType.AUTO)
    private Integer navigationId;

    @ApiModelProperty(value = "类型 0菜单 1单页内容 2外部链接")
    private Integer type;

    @ApiModelProperty(value = "模型")
    private String model;

    @ApiModelProperty(value = "模型名称")
    private String modelName;

    @ApiModelProperty(value = "别名")
    private String code;

    @ApiModelProperty(value = "上级id, 0是顶级")
    private Integer parentId;

    @ApiModelProperty(value = "菜单名称")
    private String title;

    @ApiModelProperty(value = "菜单路由地址")
    private String path;

    @ApiModelProperty(value = "菜单组件地址, 目录可为空")
    private String component;

    @ApiModelProperty(value = "菜单组件地址, 目录可为空")
    @TableField(exist = false)
    private String componentPath;

    @ApiModelProperty(value = "打开位置")
    private String target;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "图标颜色")
    private String color;

    @ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
    private Integer hide;

    @ApiModelProperty(value = "访问权限 0所有人 登录可见 密码可见")
    private Integer permission;

    @ApiModelProperty(value = "用于访问")
    private String password;

    @ApiModelProperty(value = "位置 0不限 1顶部 2底部")
    private Integer position;

    @ApiModelProperty(value = "顶部 0隐藏 1显示")
    private Integer top;

    @ApiModelProperty(value = "底部 0隐藏 1显示")
    private Integer bottom;

    @ApiModelProperty(value = "菜单侧栏选中的path")
    private String active;

    @ApiModelProperty(value = "其它路由元信息")
    private String meta;

    @ApiModelProperty(value = "css样式")
    private String style;

    @ApiModelProperty(value = "页面ID")
    private Integer pageId;

    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @ApiModelProperty(value = "设为首页")
    private Integer home;

    @ApiModelProperty(value = "排序(数字越小越靠前)")
    private Integer sortNumber;

    @ApiModelProperty(value = "备注")
    private String comments;

    @ApiModelProperty(value = "状态, 0正常, 1冻结")
    private Integer status;

    @ApiModelProperty(value = "是否删除, 0否, 1是")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "是否微信小程序菜单")
    private Boolean isMpWeixin;

    @ApiModelProperty(value = "租户id")
    private Integer tenantId;

    @ApiModelProperty(value = "注册时间")
    private Date createTime;

    @ApiModelProperty(value = "页面名称")
    @TableField(exist = false)
    private String pageName;

    @ApiModelProperty("子菜单")
    @TableField(exist = false)
    private List<Navigation> children;

    @ApiModelProperty(value = "页面布局")
    @TableField(exist = false)
    private String layout;

    @ApiModelProperty(value = "关联的页面")
    @TableField(exist = false)
    private Design design;

    @ApiModelProperty(value = "父级栏目链接")
    private String parentPath;

    @ApiModelProperty(value = "父级栏目名称")
    private String parentName;

    @ApiModelProperty(value = "当前栏目名称")
    @TableField(exist = false)
    private String categoryName;

    @ApiModelProperty(value = "当前栏目链接")
    @TableField(exist = false)
    private String categoryPath;

    public String getCategoryName() {
      return this.title;
    }

    public String getCategoryPath() {
      return this.path;
    }
}
