package com.copy.trade.enums;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum TraderEnum {
    NO_TRADER(10,"普通用户"),
    APPLYING_TRADER(15, "交易员申请中"),
    TRADER(20,"交易员"),
    REJECTION(30,"申请被拒"),
    ;

    private Integer status;
    private String des;

    TraderEnum(Integer status, String des) {
        this.status = status;
        this.des = des;
    }
    public static TraderEnum getTraderEnum(Integer status){
        return Arrays.asList(values()).stream().filter(traderEnum -> traderEnum.status.equals(status))
                .findFirst().orElse(null);
    }
}
