package com.dgtly.system.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.dgtly.common.annotation.Excel;
import com.dgtly.common.core.domain.TreeEntity;

/**
 * 权限对象 sys_user_order_author
 * 
 * @author dgtly
 * @date 2022-03-22
 */
public class SysUserOrderAuthor extends TreeEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 权限ID
     */
    private Long authorId;

    /**
     * 权限名称
     */
    @Excel(name = "权限名称")
    private String authorName;

    /**
     * 父权限ID
     */
    @Excel(name = "父权限ID")
    private Long parentId;

    /**
     * 权限编码
     */
    @Excel(name = "权限编码")
    private String code;

    /**
     * 显示顺序
     */
    @Excel(name = "显示顺序")
    private Integer orderNum;

    /**
     * 权限类型（A应用 M目录 C菜单 F按钮）
     */
    @Excel(name = "权限类型", readConverterExp = "A=应用,M=目录,C=菜单,F=按钮")
    private String authorType;

    public void setAuthorId(Long authorId) {
        this.authorId = authorId;
    }

    public Long getAuthorId() {
        return authorId;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getAuthorName() {
        return authorName;
    }

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

    public Long getParentId() {
        return parentId;
    }

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

    public String getCode() {
        return code;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setAuthorType(String authorType) {
        this.authorType = authorType;
    }

    public String getAuthorType() {
        return authorType;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("authorId", getAuthorId())
                .append("authorName", getAuthorName())
                .append("parentId", getParentId())
                .append("code", getCode())
                .append("orderNum", getOrderNum())
                .append("authorType", getAuthorType())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null) {
            return false;
        }

        if (getClass() != o.getClass()) {
            return false;
        }
        SysUserOrderAuthor order = (SysUserOrderAuthor) o;
        if (!authorId.equals(order.authorId)) {
            return false;
        }
        if (parentId == null) {
            if (order.parentId != null) {
                return false;
            }
        } else {
            if (!parentId.equals(order.parentId)) {
                return false;
            }

        }
        return true;
    }
    @Override
    public int hashCode() {
        return 1;
    }
}