package com.ruoyi.cai.enums;

import lombok.Getter;

@Getter
public enum AccountBusinessEnum {

    /**
     * 提现
     */
    WITHDRAW(AccountChangeEnum.WITHDRAW,null,null,null),
    /**
     * 守护
     */
    GUARD(AccountChangeEnum.USER_GUARD,AccountChangeEnum.ANCHOR_GUARD,AccountChangeEnum.ONE_GUARD,AccountChangeEnum.UNION_GUARD),
    /**
     * 赠送礼物
     */
    GIFT(AccountChangeEnum.USER_GIFT,AccountChangeEnum.ANCHOR_GIFT,AccountChangeEnum.ONE_GIFT,AccountChangeEnum.UNION_GIFT),
    /**
     * 视频
     */
    VIDEO(AccountChangeEnum.USER_VIDEO,AccountChangeEnum.ANCHOR_VIDEO,AccountChangeEnum.ONE_VIDEO,AccountChangeEnum.UNION_VIDEO),

    /**
     * 充值
     */
    RECHARGE(AccountChangeEnum.USER_RECHARGE,null,AccountChangeEnum.ONE_RECHARGE,null),
    ;
    private final AccountChangeEnum sourceEnum;
    private final AccountChangeEnum targetEnum;
    private final AccountChangeEnum oneEnum;
    private final AccountChangeEnum unionEnum;

    AccountBusinessEnum(AccountChangeEnum sourceEnum, AccountChangeEnum targetEnum, AccountChangeEnum oneEnum, AccountChangeEnum unionEnum) {
        this.sourceEnum = sourceEnum;
        this.targetEnum = targetEnum;
        this.oneEnum = oneEnum;
        this.unionEnum = unionEnum;
    }

    public static AccountBusinessEnum getByName(String name){
        AccountBusinessEnum[] values = AccountBusinessEnum.values();
        for (AccountBusinessEnum value : values) {
            if(value.name().equals(name)){
                return value;
            }
        }
        return null;
    }
}
