package com.jeesharp.business.modules.pay.paychannelconfig.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 支付渠道公共配置启用状态。
 *
 * @author jeesharp
 * @since 2026-05-25
 */
@Getter
@AllArgsConstructor
public enum PayChannelConfigStatusEnum {

    DISABLED(0, "禁用"),
    ENABLED(1, "启用");

    private final Integer value;
    private final String desc;

    public static PayChannelConfigStatusEnum fromValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (PayChannelConfigStatusEnum e : values()) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        return null;
    }

    public static String getDescByValue(Integer value) {
        PayChannelConfigStatusEnum e = fromValue(value);
        return e != null ? e.getDesc() : "";
    }
}
