
package com.tmerclub.cloud.multishop.constant;

/**
 * 收支类型 0支出 1收入
 *
 * @Author lth
 * @Date 2021/6/10 14:12
 */
public enum ShopWalletIoType {
    /**
     * 0.支出
     */
    EXPENDITURE(0, "支出"),
    /**
     * 1. 收入
     */
    INCOME(1, "收入"),
    ;

    private final Integer num;
    private final String str;

    public Integer value() {
        return num;
    }

    public String str() {
        return str;
    }

    ShopWalletIoType(Integer num, String str) {
        this.num = num;
        this.str = str;
    }

    public static ShopWalletIoType instance(Integer value) {
        ShopWalletIoType[] enums = values();
        for (ShopWalletIoType typeEnum : enums) {
            if (typeEnum.value().equals(value)) {
                return typeEnum;
            }
        }
        return null;
    }

    public static String getIoName(Integer value) {
        ShopWalletIoType[] enums = values();
        for (ShopWalletIoType statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum.str;
            }
        }
        return null;
    }
}
