package com.cf.imes.module.system.enums.pay;

import com.cf.imes.framework.excel.core.convert.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 交易类型枚举
 * @author Gqr
 * @since 2025/8/12 17:45
 */
@Getter
@AllArgsConstructor
public enum TradeTypeEnum implements BaseEnum {
    /**
     * 充值
     */
    RECHARGE(0, "充值"),

    /**
     * 产品购买
     */
    PRODUCT(1, "产品购买");

    private final Integer code;

    private final String desc;

    public static TradeTypeEnum fromCode(Integer code) {
        for (TradeTypeEnum value : TradeTypeEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
