package co.yixiang.yshop.module.distributor.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;
import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum DistributorWithdrawalMethodTypeEnum {

    BALANCE(0, "余额"),
    AIL_PAY(1, "支付宝"),
    ;

    private Integer type;

    private String paymentMethod;

    public static DistributorWithdrawalMethodTypeEnum toType(Integer type) {
        return Stream.of(DistributorWithdrawalMethodTypeEnum.values())
                .filter(p -> Objects.equals(p.type, type))
                .findAny()
                .orElse(null);
    }

}
