package com.hai.order.type;

import java.util.Objects;

/**
 * @className: OrderRefundOrderOpUserType
 * @author: HuRui
 * @date: 2022/11/2
 **/
public enum OrderRefundOpUserType {
    TYPE1(1, "系统"),
    TYPE2(2, "管理员"),
    TYPE3(3, "用户"),
    ;

    private Integer number;

    private String name;

    OrderRefundOpUserType(int number, String name) {
        this.number = number;
        this.name = name;
    }

    /**
     * 根据类型查询数据
     * @param type
     * @return
     */
    public static OrderRefundOpUserType getDataByType(Integer type) {
        for (OrderRefundOpUserType ele : values()) {
            if(Objects.equals(type,ele.getNumber())) return ele;
        }
        return null;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
