package com.yuchen.saas.payment.api.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zhouhanwei
 * @create 2023/12/4 14:18
 */
@Getter
@AllArgsConstructor
public enum PayChannelEnum {

    XC_PAY("xc_pay", "厦门银行支付"),
    ALL_IN_PAY("all_in_pay", "通联支付"),
    SYSTEM_WALLET_PAY("system_wallet_pay", "系统钱包支付"),
    SYSTEM_COUPON_DEDUCTION("system_coupon_deduction", "系统优惠券抵扣"),
    SYSTEM_PREPAID_DEPOSIT_DEDUCTION("system_prepaid_deposit_deduction", "系统预存款抵扣"),
    ;

    private final String code;
    private final String desc;

    public static String getEnumDesc(String code) {
        if (StrUtil.isNotBlank(code)) {
            for (PayChannelEnum e : PayChannelEnum.values()) {
                if (e.getCode().equals(code)) {
                    return e.getDesc();
                }
            }
        }
        return null;
    }
}
