package com.inspect.system.domain;

import com.inspect.base.core.web.domain.BaseEntity;

import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@Setter
public class SysMenu extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private Long menuId;
    private String menuName;
    private String parentName;
    private Long parentId;
    private Integer orderNum;
    private String path;
    private String component;
    private String query;
    private String isFrame;
    private String isCache;
    private String menuType;
    private String visible;
    private String status;
    private String perms;
    private String icon;
    private List<SysMenu> children = new ArrayList();

    public Long getMenuId() {
        return this.menuId;
    }

    @NotBlank(
            message = "菜单名称不能为空"
    )
    @Size(
            min = 0,
            max = 50,
            message = "菜单名称长度不能超过50个字符"
    )
    public String getMenuName() {
        return this.menuName;
    }

    public String getParentName() {
        return this.parentName;
    }

    public Long getParentId() {
        return this.parentId;
    }

    @NotNull(
            message = "显示顺序不能为空"
    )
    public Integer getOrderNum() {
        return this.orderNum;
    }

    @Size(
            min = 0,
            max = 200,
            message = "路由地址不能超过200个字符"
    )
    public String getPath() {
        return this.path;
    }

    @Size(
            min = 0,
            max = 200,
            message = "组件路径不能超过255个字符"
    )
    public String getComponent() {
        return this.component;
    }

    public String getQuery() {
        return this.query;
    }

    public String getIsFrame() {
        return this.isFrame;
    }

    public String getIsCache() {
        return this.isCache;
    }

    @NotBlank(
            message = "菜单类型不能为空"
    )
    public String getMenuType() {
        return this.menuType;
    }

    public String getVisible() {
        return this.visible;
    }

    public String getStatus() {
        return this.status;
    }

    @Size(
            min = 0,
            max = 100,
            message = "权限标识长度不能超过100个字符"
    )
    public String getPerms() {
        return this.perms;
    }

    public String getIcon() {
        return this.icon;
    }

    public List<SysMenu> getChildren() {
        return this.children;
    }

    @Override
    public String toString() {
        return "SysMenu{" +
                "menuId=" + menuId +
                ", menuName='" + menuName + '\'' +
                ", parentName='" + parentName + '\'' +
                ", parentId=" + parentId +
                ", orderNum=" + orderNum +
                ", path='" + path + '\'' +
                ", component='" + component + '\'' +
                ", query='" + query + '\'' +
                ", isFrame='" + isFrame + '\'' +
                ", isCache='" + isCache + '\'' +
                ", menuType='" + menuType + '\'' +
                ", visible='" + visible + '\'' +
                ", status='" + status + '\'' +
                ", perms='" + perms + '\'' +
                ", icon='" + icon + '\'' +
                ", children=" + children +
                '}';
    }
}
