package com.hys.app.model.system.dos;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hys.app.framework.database.annotation.PrimaryKeyField;

import com.hys.app.model.system.enums.MenuTypeEnum;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


/**
 * 菜单表实体
 *
 * @author zh
 * @version v7.0.0
 * @since v7.0.0
 * 2018-06-20 09:29:19
 */
@TableName("es_menu")
@ApiModel
@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
public class Menu implements Serializable {
    private static final long serialVersionUID = 3033586331756935L;

    /**
     * 菜单id
     */
    @TableId(type= IdType.ASSIGN_ID)
    @ApiModelProperty(hidden = true)
    private Long id;
    /**
     * 父id
     */
    @ApiModelProperty(name = "parent_id", value = "父id", required = false)
    private Long parentId;
    /**
     * 菜单标题
     */
    @ApiModelProperty(name = "title", value = "菜单标题", required = false)
    private String title;
    /**
     * 菜单url
     */
    @ApiModelProperty(name = "url", value = "菜单url", required = false)
    private String url;
    /**
     * 菜单唯一标识
     */
    @ApiModelProperty(name = "identifier", value = "菜单唯一标识", required = false)
    private String identifier;
    /**
     * 权限表达式
     */
    @ApiModelProperty(name = "auth_regular", value = "权限表达式", required = false)
    private String authRegular;
    /**
     * 删除标记
     */
    @ApiModelProperty(name = "delete_flag", value = "删除标记", required = false)
    private Integer deleteFlag;
    /**
     * 菜单级别标识
     */
    @ApiModelProperty(name = "path", value = "菜单级别标识", required = false)
    private String path;
    /**
     * 菜单级别标识
     */
    @ApiModelProperty(name = "show_home", value = "首页显示", required = false)
    private Short showHome;

    /**
     * 菜单级别标识
     */
    @ApiModelProperty(name = "icon", value = "菜单图标", required = false)
    private String icon;
    /**
     * 菜单级别
     */
    @ApiModelProperty(name = "grade", value = "菜单级别", required = false)
    private Integer grade;
    /**
     * 菜单类型
     */
    @ApiModelProperty(name = "type", value = "菜单类型", required = false)
    private MenuTypeEnum type;




    @PrimaryKeyField
    public Long getId() {
        return id;
    }


    public void setShowHome(Short showHome) {
        this.showHome = showHome;
    }

    public Short getShowHome() {
        return showHome;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }


    public String getIcon() {
        return icon;
    }

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

    public Long getParentId() {
        return parentId;
    }

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

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

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

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getAuthRegular() {
        return authRegular;
    }

    public void setAuthRegular(String authRegular) {
        this.authRegular = authRegular;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Integer getGrade() {
        return grade;
    }

    public void setGrade(Integer grade) {
        this.grade = grade;
    }

    public MenuTypeEnum getType() {
        return type;
    }

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

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Menu that = (Menu) o;
        if (id != null ? !id.equals(that.id) : that.id != null) {
            return false;
        }
        if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) {
            return false;
        }
        if (title != null ? !title.equals(that.title) : that.title != null) {
            return false;
        }
        if (url != null ? !url.equals(that.url) : that.url != null) {
            return false;
        }
        if (identifier != null ? !identifier.equals(that.identifier) : that.identifier != null) {
            return false;
        }
        if (authRegular != null ? !authRegular.equals(that.authRegular) : that.authRegular != null) {
            return false;
        }
        if (deleteFlag != null ? !deleteFlag.equals(that.deleteFlag) : that.deleteFlag != null) {
            return false;
        }
        if (path != null ? !path.equals(that.path) : that.path != null) {
            return false;
        }
        return grade != null ? grade.equals(that.grade) : that.grade == null;
    }

    @Override
    public int hashCode() {
        int result = 0;
        result = 31 * result + (id != null ? id.hashCode() : 0);
        result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (identifier != null ? identifier.hashCode() : 0);
        result = 31 * result + (authRegular != null ? authRegular.hashCode() : 0);
        result = 31 * result + (deleteFlag != null ? deleteFlag.hashCode() : 0);
        result = 31 * result + (path != null ? path.hashCode() : 0);
        result = 31 * result + (grade != null ? grade.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Menu{" +
                "id=" + id +
                ", parentId=" + parentId +
                ", title='" + title + '\'' +
                ", url='" + url + '\'' +
                ", identifier='" + identifier + '\'' +
                ", authRegular='" + authRegular + '\'' +
                ", deleteFlag=" + deleteFlag +
                ", path='" + path + '\'' +
                ", grade=" + grade +
                '}';
    }

}
