package com.app.entity.platform.system;

import com.app.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;

/**
 * 功能描述：资源实体
 *
 * @Auther 梁展鹏
 * @Date 2020/1/18 16:03
 */
@ApiModel("资源实体")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("t_platform_resource")
public class Resource extends BaseEntity {

    @ApiModelProperty(value = "父级菜单")
    @TableField("parent_id")
    private String parentId;

    @ApiModelProperty("名称")
    @NotBlank
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "组件名称")
    @TableField("component_name")
    private String componentName;

    @ApiModelProperty(value = "组件路径")
    @TableField("component_path")
    private String componentPath;

    @ApiModelProperty("路由地址")
    @TableField("path")
    private String path;

    @ApiModelProperty("菜单类型：目录、菜单、按钮")
    @NotEmpty
    @TableField("resource_type")
    private String resourceType;

    /**
     * menu例子：role:*
     * button例子：role:create,role:update,role:delete,role:view
     */
    @ApiModelProperty("权限字符串")
    @TableField("permission")
    private String permission;

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

    @ApiModelProperty(value = "缓存")
    @TableField("cache")
    private Boolean cache;

    @ApiModelProperty(value = "是否隐藏")
    @TableField("hidden")
    private Boolean hidden;

    @ApiModelProperty(value = "外链菜单")
    @TableField("link")
    private Boolean link;

    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty("备注")
    @TableField("remarks")
    private String remarks;

}
