package com.panyz.panframe.networkDemo;

import com.panyz.corelib.mvp.BaseModel;
import com.panyz.corelib.mvp.BaseRequestCallBack;
import com.panyz.corelib.net.client.NetworkExecutor;
import com.panyz.corelib.net.request.CoreRequest;
import com.panyz.corelib.net.request.RequestParams;

import okhttp3.Request;

/**
 * @Project: PanFrame
 * @Package: com.panyz.panframe.networkDemo
 * @Description: TODO
 * @Company: 深圳君南信息系统有限公司
 * @Autor: panyz
 * @Date: 2017年08月07日 16:29
 */
public class HomeModel extends BaseModel {

    String url = "http://5923d9433d82370011e6b662.mockapi.io/data/Test";

    public HomeModel(BaseRequestCallBack callBack) {
        super(callBack);
    }

    public void loadData() {
        RequestParams params = new RequestParams();
        Request request = CoreRequest.doGetRequest(url, params);
        NetworkExecutor executor = getExecutor(HomeBean.class);
        httpClient.sendRequest(request,executor);
    }
}
