package com.storlead.system.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.storlead.framework.mybatis.entity.SysBaseField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>
 * 按钮组
 * </p>
 *
 * @author chenkq
 * @since 2022-03-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_resource_menu")
public class SysResourceMenuEntity extends SysBaseField {

    private static final long serialVersionUID = 1L;

    /**
     * 主键Id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "主键id" )
    private Long id;

    /**
     * 资源code
     */
    @ApiModelProperty(value = "资源code")
    private String resourceCode;

    /**
     * 资源名称
     */
    @ApiModelProperty(value = "资源名称")
    private String resourceName;

    /**
     * 所属菜单或页面(父级ID)
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "菜单名称")
    private String title;

    /**
     * 所属菜单或页面(父级ID)
     */
    @ApiModelProperty(value = "菜单id")
    private Long menuId;

    /**
     * 所属菜单或页面(父级ID)
     */
    @ApiModelProperty(value = "菜单名称")
    private String menuName;

    /**
     * 所属菜单或页面(父级ID)
     */
    @ApiModelProperty(value = "菜单code")
    private String menuCode;

    /**
     * 父级id
     */
    @ApiModelProperty(value = "父id")
    private Long parentId;

    /**
     * 权限类型:10:数据权限按钮 ,20:普通权限按钮
     */
    @ApiModelProperty(value = "权限类型:10:数据权限 ,20:按钮权限(按钮下面不能挂按钮)")
    private Integer permissionType;

    @ApiModelProperty(value = "是否绑定数据权限,0:不绑定, 1:绑定")
    private Integer bindData;

    @TableField(exist = false)
    private List<SysResourceMenuEntity> children;

    @TableField(exist = false)
    private Boolean hasChildren;

}
