package com.cool.bang.modules.system.domain.po;

import com.cool.bang.common.base.BaseDomain;
import com.cool.bang.common.constant.enums.StatusType;

import java.util.ArrayList;
import java.util.List;

/**
 * system menu table
 *
 * @author PeiZhi Guo
 * 2021-2-18 14:26
 */
public class Menu extends BaseDomain {

    private static final long serialVersionUID = 1L;

    private Long id;

    private Long parentId; //父键

    private String  title; //权限名称

    private Integer type; //权限类型

    private String  code; //权限标识

    private String  href; //权限路径

    private String  icon; //权限图标

    private Integer sort; //权限排序

    private Integer enable; //启用标识 0:禁用 1:启用

    private Integer delFlag; //删除标识 0:删除 1:正常

    private String isAuthType; //是否拥有权限

    private List<Menu> children = new ArrayList<>();

    @Override
    public void insertConfigure() {
        this.enable = StatusType.ENABLE.ordinal();
        this.delFlag = StatusType.ENABLE.ordinal();
        super.insertConfigure();
    }

    public Long getId() {
        return id;
    }

    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 Integer getType() {
        return type;
    }

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

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getIcon() {
        return icon;
    }

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

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getEnable() {
        return enable;
    }

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

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public String getIsAuthType() {
        return isAuthType;
    }

    public void setIsAuthType(String isAuthType) {
        this.isAuthType = isAuthType;
    }

    public List<Menu> getChildren() {
        return children;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "Menu{" +
                "id=" + id +
                ", parentId=" + parentId +
                ", title='" + title + '\'' +
                ", type=" + type +
                ", code='" + code + '\'' +
                ", href='" + href + '\'' +
                ", icon='" + icon + '\'' +
                ", sort=" + sort +
                ", enable=" + enable +
                ", delFlag=" + delFlag +
                ", isAuthType='" + isAuthType + '\'' +
                ", children=" + children +
                '}';
    }
}
