package com.game.common.constant.finance;

import com.game.common.constant.ProjConfig;
import com.game.common.entity.KeyValue;

import java.util.ArrayList;

/**
 * @author jiang
 */

public enum FinTranType2 {

    /**
     * 未知的
     */
    TypeNone(0, "10986"),
    /**
     * 充值
     */
    CHARGE(10, "11212"),
    /**
     * 奖励收益
     */
    REWARD_Income(12, "11169"),
    /**
     * 推荐佣金
     */
    RECOMMEND_AMOUNT(50, "11213"),
    /**
     * 兑换金币
     */
    EXCHANGE_COIN(13, "11214" + ProjConfig.getCoinName()),
    /**
     * 兑换余额
     */
    EXCHANGE_DiamondCoin(14, "11214" + ProjConfig.getD_ticketName()),
    /**
     * 游戏中奖
     */
    GAME_REWARD(15, "11215"),

    /**
     * 转账
     */
    USER_TRANSFER(16, "11215"),
    /**
     * 打赏
     */
    CONSUM_SEND_GIFT(20, "11216"),
    /**
     * 点歌
     */
    CONSUM_CHOOSE_SONG(21, "11217"),
    /**
     * 付费直播回放
     */
    CONSUM_PAY_COIN_LIVE_REPLAY(22, "11218"),
    /**
     * 私密视图
     */
    CONSUM_PRIVATE_VIEW(23, "11168"),
    /**
     * 守护
     */
    CONSUM_GUARD(24, "11219"),
    /**
     * 粉丝团
     */
    CONSUM_FANS_TEAM(25, "11061"),
    /**
     * 发送弹幕
     */
    CONSUM_SEND_BARRAGE(26, "11166"),
    /**
     * 购买贵族
     */
    CONSUM_BUY_NOBLE(27, "11220"),
    /**
     * 付费通话
     */
    CONSUM_PAY_COIN_1V1(28, "11129"),
    /**
     * 购买道具
     */
    CONSUM_BUY_PROP(29, "11221"),
    /**
     * 游戏消费
     */
    CONSUM_GAME(200, "11222"),
    /**
     * 红包
     */
    CONSUM_RED_PACKAGE(201, "11223"),
    /**
     * 查看联系方式
     */
    CONSUM_WATCH_CONTACT(202, "11224"),
    /**
     * 购买SVIP
     */
    CONSUM_BUY_SVIP(204, "11225"),
    /**
     * 房间费用
     */
    CONSUM_ROOM_COIN(205, "11226"),
    /**
     * 付费私信
     */
    CONSUM_CHAT_CHARGES(206, "11173"),
    /**
     * 购买贵宾席
     */
    CONSUM_BUY_VIPSEATS(208, "11227"),
    /**
     * 游戏抽奖
     */
    CONSUM_LUCK_DRAW(209, "11228"),
    /**
     * 提现
     */
    CASH(60, "11229"),
    /**
     * 寻觅订单
     */
    SEEK_ORDER(220, "11230"),

    /**
     * 长视频（电视剧）
     */
    TV_VIDEO(221, "11231"),
    /**
     * 盲盒
     */
    BLIND_BOX(222, "11232"),
    ;

    private int type;
    private String name;

    static KeyValue[] m_KeyValueArr;

    public static KeyValue[] getKeyValues() {
        if (m_KeyValueArr == null) {
            ArrayList<KeyValue> listKV = new ArrayList<>();
            listKV.add(new KeyValue("", "全部", true));
            for (FinTranType2 m : FinTranType2.values()) {
                KeyValue kv = new KeyValue("" + m.type, m.name);
                listKV.add(kv);
            }
            m_KeyValueArr = listKV.toArray(new KeyValue[0]);
        }
        return m_KeyValueArr;
    }

    FinTranType2(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static String getNameDescribe(int type) {
        for (FinTranType2 m : FinTranType2.values()) {
            if (m.type == type) {
                return m.name;
            }
        }
        return null;
    }
}
