package com.kfzs.duanduan.utils;

import com.kfzs.duanduan.proto.VoucherOuterClass;

/**
 * @ Created by Dlg
 * @ <p>TiTle:  CouponUtils</p>
 * @ <p>Description:</p>
 * @ date:  2017/12/19 13:06
 * @ QQ:    315096953
 */

public class CouponUtils {


    /**
     * 根据优惠券类型返回优惠券名
     *
     * @param voucher
     * @return
     */
    public String getVoucherName(VoucherOuterClass.Voucher voucher) {
        switch (voucher.getVoucherType()) {
            case 1:
                return "首充券";
            case 2:
                return "满减券";
        }

        return "首充券";
    }

    /**
     * 获取券的说明
     *
     * @param voucher
     * @return
     */
    public String getVoucherContent(VoucherOuterClass.Voucher voucher) {
        switch (voucher.getVoucherType()) {
            case 1:
                return "仅限" + voucher.getGameName() + "首充使用";
            case 2:
                return "仅限" + voucher.getGameName() + "，满" + voucher.getCondition() + "减" + voucher.getAmount();
        }
        return "仅用于" + voucher.getGameName() + "充值";
    }


}
