package com.sipai.jspatrol.Patrol.patrolList;

import android.content.Context;

import com.sipai.jspatrol.Base.BasePresenter;
import com.sipai.jspatrol.Bean.LoginInfo;

import java.util.HashMap;

/**
 * created by lvliming on 2019/9/11
 */
public class PatrolListPresenter extends BasePresenter<PatrolListActivity, PatrolListModel, PatrolListContract.Presenter> {

    @Override
    public PatrolListContract.Presenter getContract() {
        return new PatrolListContract.Presenter<LoginInfo>(){
            @Override
            public void requestData(Context context,HashMap<String, String> map, String server, String url) {
                try {
                    m.getContract().executeData(context,map,server,url);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }

            @Override
            public void responseResult(LoginInfo item) {
                getView().getContract().handlerResult(item);
            }
        };
    }

    @Override
    public PatrolListModel getModel() {
        return new PatrolListModel(this);
    }
}
