package com.gci.boot.modules.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.common.dict.excel.DictConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.alibaba.excel.annotation.ExcelProperty;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author chenzhiwei
 * @since 2023-08-22
 */
@Data
@TableName("sys_permission")
@ApiModel(value = "SysPermission对象", description = "菜单权限表")
public class SysPermission implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty("父id")
    private String parentId;

    @ApiModelProperty("菜单标题")
    private String name;

    @ApiModelProperty("路径")
    private String url;

    @ApiModelProperty("组件")
    private String component;

    @ApiModelProperty("组件名字")
    private String componentName;

    @ApiModelProperty("一级菜单跳转地址")
    private String redirect;

    @ApiModelProperty("菜单类型(0:一级菜单; 1:子菜单:2:按钮权限)")
    private Integer menuType;

    @ApiModelProperty("菜单权限编码")
    private String perms;

    @ApiModelProperty("权限策略1显示2禁用")
    private String permsType;

    @ApiModelProperty("菜单排序")
    private Double sortNo;

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

    @ApiModelProperty("是否叶子节点:    1:是   0:不是")
    private Integer isLeaf;

    @ApiModelProperty("描述")
    private String description;

    @ApiModelProperty("按钮权限状态(0无效1有效)")
    private String status;

    @ApiModelProperty("是否添加数据权限1是0否")
    private Integer ruleFlag;

    @ApiModelProperty("创建人")
    private String createBy;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新人")
    @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname")
    @ExcelProperty(value = "更新人",converter = DictConverter.class)
    private String updateBy;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("是否隐藏路由: 0否,1是")
    private Integer hidden;

    @ApiModelProperty("外链菜单打开方式 0/内部打开 1/外部打开")
    private Integer internalOrExternal;

}
