package com.sckw.payment.api.model.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ChannelEnum {
    HF("11", "1", "huifu", "汇付渠道"),
    XS("12", "2", "newpay", "新生渠道"),
    ZX("13", "3", "citic", "中信渠道");
    private final String code;//预付款+支付渠道
    private final String value;//渠道对应的字典值
    private final String channel;
    private final String desc;

    public static ChannelEnum getByCode(String code) {
        for (ChannelEnum channelEnum : ChannelEnum.values()) {
            if (channelEnum.getCode().equals(code)) {
                return channelEnum;
            }
        }
        return null;
    }

}
