package com.oo.seex.netlibrary.net;


import com.oo.seex.netlibrary.net.Api.ServiceFactory;

/**
 * Desc:
 * Author: pl
 * Date: 2017-03-15 17:35
 */

public abstract class BaseNetManager {

    private ServiceFactory serviceFactory;

    public <T> T getApiService(Class<T> clazz) {
        setBaseNet();
        if(BaseApiConfig.isDebug()){
            return serviceFactory.createDebugService(clazz);
        }else {
            return serviceFactory.createReleaseService(clazz);
        }
    }

    protected abstract void setBaseNet();

    public BaseNetManager() {
        serviceFactory = ServiceFactory.getInstance();
    }

}
