package com.qmth.sop.business.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.enums.PrivilegeEnum;
import com.qmth.sop.common.enums.PrivilegePropertyEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author wangliang
 * @since 2023-07-17
 */
@ApiModel(value = "SysPrivilege对象", description = "菜单权限表")
public class SysPrivilege implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

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

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

    @ApiModelProperty(value = "上级菜单")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

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

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

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

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

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

    @ApiModelProperty(value = "是否前端展示")
    private Boolean frontDisplay;

    public Long getId() {
        return id;
    }

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

    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 PrivilegePropertyEnum getProperty() {
        return property;
    }

    public void setProperty(PrivilegePropertyEnum 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;
    }

    public Boolean getDefaultAuth() {
        return defaultAuth;
    }

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

    public Boolean getFrontDisplay() {
        return frontDisplay;
    }

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