package com.qmth.teachcloud.common.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.enums.PrivilegeEnum;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
@TableName("sys_privilege")
public class SysPrivilege implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键")
    @TableId(value = "id")
    private Long id;

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

    @ApiModelProperty(value = "地址")
    @TableField(value = "url")
    private String url;

    @ApiModelProperty(value = "类型，MENU：菜单，BUTTON：按钮，LINK：链接，URL：接口地址，LIST：列表，CONDITION：查询条件，TAB：选项卡")
    @TableField(value = "type")
    private PrivilegeEnum type;

    @ApiModelProperty(value = "父id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "parent_id")
    private Long parentId;

    @ApiModelProperty(value = "序号")
    @TableField(value = "sequence")
    private Integer sequence;

    @ApiModelProperty(value = "属性，NO_AUTH：无需鉴权，AUTH：鉴权，SYS：系统公用")
    @TableField(value = "property")
    private String property;

    @ApiModelProperty(value = "关联属性，type为URL且property为AUTH才有")
    @TableField(value = "related")
    @JsonSerialize(using = ToStringSerializer.class)
    private String related;

    @ApiModelProperty(value = "是否启用，0：停用，1：启用")
    @TableField(value = "enable")
    private Boolean enable;

    @ApiModelProperty(value = "默认权限，0：否，1：是")
    @TableField(value = "default_auth")
    private Boolean defaultAuth;

    @ApiModelProperty(value = "是否前端展示，0：否，1：是")
    @TableField(value = "front_display")
    private Boolean frontDisplay;

    public Boolean getFrontDisplay() {
        return frontDisplay;
    }

    public void setFrontDisplay(Boolean frontDisplay) {
        this.frontDisplay = frontDisplay;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getDefaultAuth() {
        return defaultAuth;
    }

    public void setDefaultAuth(Boolean defaultAuth) {
        this.defaultAuth = defaultAuth;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public PrivilegeEnum getType() {
        return type;
    }

    public void setType(PrivilegeEnum type) {
        this.type = type;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getSequence() {
        return sequence;
    }

    public void setSequence(Integer sequence) {
        this.sequence = sequence;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getRelated() {
        return related;
    }

    public void setRelated(String related) {
        this.related = related;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }
}
