package com.ruoyi.xq.enums.user;


import lombok.Getter;

@Getter
public enum AccountChangeCodeEnum {
    WITHDRAW(201,AccountCateEnum.WITHDRAW,"提现","",false),
    WITHDRAW_FAIL(202,AccountCateEnum.WITHDRAW,"提现失败","",true),

    VIP_INVITE(301,AccountCateEnum.AWARD_INVITE,"邀请奖励（VIP）","",true),

    SYSTEM_COIN_INCS(801,AccountCateEnum.SYSTEM_TRANS,"系统调账","后台新增余额",true),
    SYSTEM_COIN_DECR(802,AccountCateEnum.SYSTEM_TRANS,"系统调账","后台减少余额",false),
    SYSTEM_INCOME_COIN_INCS(803,AccountCateEnum.SYSTEM_TRANS,"系统调账","后台新增收益",true),
    SYSTEM_INCOME_COIN_DECR(804,AccountCateEnum.SYSTEM_TRANS,"系统调账","后台减少收益",false),
    ;

    private final Integer code;
    private final AccountCateEnum cate;
    private final String text;
    private final String desc;
    /**
     * 是否为进账
     */
    private final Boolean in;

    AccountChangeCodeEnum(Integer code, AccountCateEnum cate, String text, String desc, Boolean in) {
        this.code = code;
        this.cate = cate;
        this.text = text;
        this.desc = desc;
        this.in = in;
    }

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