package com.ruoyi.cai.enums.account;


import lombok.Getter;

@Getter
public enum AccountChangeCodeEnum {
    RECHARGE(101,AccountCateEnum.RECHARGE,"余额充值",AccountTypeEnum.COIN,"",null),

    WITHDRAW(201,AccountCateEnum.WITHDRAW,"提现",AccountTypeEnum.INCOME_COIN,"",null),
    WITHDRAW_FAIL(202,AccountCateEnum.WITHDRAW,"提现失败",AccountTypeEnum.INCOME_COIN,"",null),

    VIDEO_INCOME(301,AccountCateEnum.VIDEO,"视频收入",AccountTypeEnum.INCOME_COIN,"",true),
    VIDEO_COIN_OUT(302,AccountCateEnum.VIDEO,"视频支出",AccountTypeEnum.COIN,"",false),
    VIDEO_INCOME_COIN_OUT(303,AccountCateEnum.VIDEO,"视频支出",AccountTypeEnum.INCOME_COIN,"",false),

    GIFT_INCOME(401,AccountCateEnum.GIFT,"收到礼物",AccountTypeEnum.INCOME_COIN,"",true),
    GIFT_COIN_OUT(402,AccountCateEnum.GIFT,"送出礼物",AccountTypeEnum.COIN,"",false),
    GIFT_INCOME_COIN_OUT(403,AccountCateEnum.GIFT,"送出礼物",AccountTypeEnum.INCOME_COIN,"",false),

    FAST_PAY_AWARD(501,AccountCateEnum.SYSTEM,"首充奖励",AccountTypeEnum.INCOME_COIN,"",null),
    RECHARGE_INVITE(502,AccountCateEnum.SYSTEM,"邀请奖励（充值）",AccountTypeEnum.INCOME_COIN,"",true),
    VIDEO_INVITE(503,AccountCateEnum.SYSTEM,"邀请奖励（视频）",AccountTypeEnum.INCOME_COIN,"",true),
    GIFT_INVITE(504,AccountCateEnum.SYSTEM,"邀请奖励（礼物）",AccountTypeEnum.INCOME_COIN,"",true),
    GUARD_INVITE(505,AccountCateEnum.SYSTEM,"邀请奖励（守护）",AccountTypeEnum.INCOME_COIN,"",true),
    REGISTER_AWARD(506,AccountCateEnum.SYSTEM,"注册奖励",AccountTypeEnum.INCOME_COIN,"",null),
    RANK_AWARD(507,AccountCateEnum.SYSTEM,"排行榜奖励",AccountTypeEnum.INCOME_COIN,"",null),

    IM_INCOME(701,AccountCateEnum.IM,"收到私信",AccountTypeEnum.INCOME_COIN,"",true),
    IM_COIN_OUT(702,AccountCateEnum.IM,"私信支出",AccountTypeEnum.COIN,"",false),
    IM_INCOME_COIN_OUT(703,AccountCateEnum.IM,"私信支出",AccountTypeEnum.INCOME_COIN,"",false),

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

    GUARD_INCOME(901,AccountCateEnum.GUARD,"收到守护",AccountTypeEnum.INCOME_COIN,"",true),
    GUARD_COIN_OUT(902,AccountCateEnum.GUARD,"送出守护",AccountTypeEnum.COIN,"",false),
    GUARD_INCOME_COIN_OUT(903,AccountCateEnum.GUARD,"送出守护",AccountTypeEnum.INCOME_COIN,"",false),

    UNION_INVITE(1001,AccountCateEnum.UNION,"工会分成",AccountTypeEnum.INCOME_COIN,"",true),

    ;

    private final Integer code;
    private final AccountCateEnum cate;
    private final String text;
    /**
     * 1-余额
     * 2-收益
     */
    private final AccountTypeEnum accountType;
    private final String desc;
    private final Boolean in;

    AccountChangeCodeEnum(Integer code, AccountCateEnum cate, String text, AccountTypeEnum accountType, String desc, Boolean in) {
        this.code = code;
        this.cate = cate;
        this.text = text;
        this.accountType = accountType;
        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;
    }
}
