package com.tofly.ghrq_route.module.systemConfig.service;

import android.content.Context;

import com.tofly.ghrq_route.base.URLResponseCode;
import com.tofly.ghrq_route.module.sqlite.DBDaoHelper;
import com.tofly.ghrq_route.module.systemConfig.controller.ServerSysConfigCallBack;
import com.tofly.ghrq_route.module.systemConfig.domain.ServerSysConfigBean;

import java.util.List;

/**
 * Created by Amu on 2017/8/8.
 */

public class ServerSysConfigServiceImplOffline implements IServerSysConfigService {

    private Context mContext;

    private DBDaoHelper dbDaoHelper;

    public ServerSysConfigServiceImplOffline(Context context){
        mContext = context;
        dbDaoHelper = DBDaoHelper.getInstance();
    }

    @Override
    public void getSysConfigList(final String token, final String key, final int pageindex, final int pagesize, final ServerSysConfigCallBack sysConfigCallBack) {
        int total = 0;
        List<ServerSysConfigBean> configBeans = dbDaoHelper.getServerConfigList(key);
        if (configBeans != null){
            total = configBeans.size();
        }
        sysConfigCallBack.onGetSysConfigList(true, URLResponseCode.ErrorCode.SUCCESS_OFFLINE, "", configBeans, total);
    }

    @Override
    public void getSysSetting(Context context, final ServerSysConfigCallBack sysConfigCallBack) {

    }

    @Override
    public void uploadLocalSystemLogFiles(Context context, List<String> files, ServerSysConfigCallBack sysConfigCallBack) {

    }
}
