package com.genlot.ninglottery.module.scan;

import android.os.Bundle;

import com.genlot.nativesdk.sender.EventToken;
import com.genlot.nativesdk.sender.TCPSender;
import com.genlot.ninglottery.base.BasePresenter;

/**
 * @author ZhuYongKang
 * @description 类描述
 * @date 2019/10/8
 */
public class ScanPresenter extends BasePresenter<IScanView> {

    /**
     * 中奖查询
     * @param featureCode 特征码
     */
    public void t101008CashQuery(String featureCode) {
        getView().showLoading();
        TCPSender.t101008QueryCashTicket(EventToken.T_QUERY_CASH_TICKET, 1, featureCode, new TCPSender.SenderCallback() {
            @Override
            public void onSenderSuccess(Bundle bundle) {
                getView().onQuerySuccess(bundle);
            }

            @Override
            public void onSenderFail(int code, String message) {
                getView().onQueryFail(message);
            }

        });
    }

    /**
     * 票查询
     * @param featureCode 票特征码
     */
    public void t101007QueryTicket(String featureCode) {
        getView().showLoading();
        TCPSender.t101007QueryTicket(EventToken.T_QUERY_TICKET, 1, featureCode, new TCPSender.SenderCallback() {
            @Override
            public void onSenderSuccess(Bundle bundle) {
                getView().onQuerySuccess(bundle);
            }

            @Override
            public void onSenderFail(int code, String message) {
                getView().onQueryFail(message);
            }

        });
    }
}
