package com.ruoyi.cai.enums.account;

import lombok.Getter;

@Getter
public enum AccountTypeEnum {
    COIN(1),
    INCOME_COIN(2),

    ;
    private final Integer code;

    AccountTypeEnum(Integer code) {
        this.code = code;
    }

    public static AccountTypeEnum getByCode(Integer code) {
        AccountTypeEnum[] values = AccountTypeEnum.values();
        for (AccountTypeEnum value : values) {
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}
