package com.fs.provider.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 结算方式枚举
 */
@Getter
@AllArgsConstructor
public enum SettlementMethodEnum {

    TASK_INCOME("TASK_INCOME","任务收入"),
    WITHDRAW("WITHDRAW", "提现");

    private final String code;
    private final String desc;

    public static SettlementMethodEnum fromCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (SettlementMethodEnum e : values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        throw new IllegalArgumentException("未知结算方式 code: " + code);
    }
}
