package com.mortals.xhx.base.system.menu.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.menu.model.vo.MenuVo;
import lombok.Data;
/**
 * 菜单信息业务实体对象
 *
 * @author zxfei
 * @date 2024-12-06
 */
@Data
public class MenuEntity extends MenuVo {
    private static final long serialVersionUID = 1L;

    /**
     * 菜单名称
     */
    private String name;
    /**
     * 路由地址
     */
    private String url;
    /**
     * 当前节点父id路径，“，”分割
     */
    private String ancestors;
    /**
     * 父菜单ID，一级菜单的该字段值为-1
     */
    private Long parentId;
    /**
     * 链接方式 (0.普通，1.弹出，2.脚本)
     */
    private Integer linkType;
    /**
     * 主菜单图标，主菜单图标的css样式名
     */
    private String imgPath;
    /**
     * 按钮图标，按钮图标的css样式名
     */
    private String buttonImgPath;
    /**
     * 常用菜单图标，常用菜单图标的css样式名
     */
    private String imgCommPath;
    /**
     * 是否常用菜单 (0.非常用，1.常用)
     */
    private Integer commMenu;
    /**
     * vue组件路径
     */
    private String component;
    /**
     * 菜单类型 (0.目录，1.菜单，2.按钮)
     */
    private Integer menuType;
    /**
     * 权限类型 (0.无限制，1.无需登录查看，2.需要登录查看，3.需要角色权限查看)
     */
    private Integer authType;
    /**
     * 菜单显示状态 (0.显示，1.隐藏)
     */
    private Integer visible;
    /**
     * 权限标识，多个逗号分割
     */
    private String perms;
    /**
     * 备注信息
     */
    private String remark;
    /**
     * 排序编号
     */
    private Integer orderId;
    /**
     * 菜单状态 (0.停用，1.启用)
     */
    private Integer status;
    /**
     * 创建用户名称
     */
    private String createUserName;
    /**
     * 创建用户名称
     */
    private String updateUserName;
    /**
     * 是否启用缓存 (0.否，1.是)
     */
    private Integer cache;
    /**
     * 激活目录
     */
    private String activeDir;
    /**
     * 是否隐藏(0.否，1.是)
     */
    private Integer hideChildrenInMenu;
    /**
     * 资源访问路径，多个逗号分割
     */
    private String resourceUrl;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof MenuEntity) {
            MenuEntity tmp = (MenuEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
        this.name = "";
        this.url = "";
        this.ancestors = "";
        this.parentId = null;
        this.linkType = 0;
        this.imgPath = "";
        this.buttonImgPath = "";
        this.imgCommPath = "";
        this.commMenu = 1;
        this.component = "";
        this.menuType = 0;
        this.authType = 3;
        this.visible = 0;
        this.perms = "";
        this.remark = "";
        this.orderId = 0;
        this.status = 1;
        this.createUserName = "";
        this.updateUserName = "";
        this.cache = 0;
        this.activeDir = "";
        this.hideChildrenInMenu = 0;
        this.resourceUrl = "";
    }
}