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

import android.content.Context;

import com.tofly.ghrq_route.base.URLResponseCode;
import com.tofly.ghrq_route.module.troubleType.TroubleTypeDaoHelper;
import com.tofly.ghrq_route.module.troubleType.controller.TroubleTypeCallBack;
import com.tofly.ghrq_route.module.troubleType.domain.PipeTypeBean;
import com.tofly.ghrq_route.module.troubleType.domain.SysDeviceTypeBean;
import com.tofly.ghrq_route.module.troubleType.domain.TroubleRiskLevelBean;
import com.tofly.ghrq_route.module.troubleType.domain.TroubleTypeBean;

import java.util.List;

/**
 * Created by Amu on 2017/3/7.
 */

public class TroubleTypeServiceImplOffline implements ITroubleTypeService {

    private Context mContext;

    private TroubleTypeDaoHelper dbDaoHelper;

    public TroubleTypeServiceImplOffline(Context context){
        mContext = context;
        dbDaoHelper = TroubleTypeDaoHelper.getInstance();
    }

    @Override
    public void getSysDeviceTypeList(final String token, final TroubleTypeCallBack troubleTypeCallBack) {
        List<SysDeviceTypeBean> deviceTypeBeans = dbDaoHelper.getSysDeviceTypeList();
        troubleTypeCallBack.onGetSysDeviceTypeList(true, URLResponseCode.ErrorCode.SUCCESS_OFFLINE, "", deviceTypeBeans);
    }

    @Override
    public void getTroubleTypeList(Context context, int pageindex, int pagesize, final TroubleTypeCallBack troubleTypeCallBack) {
        List<TroubleTypeBean> troubleTypeBeans = dbDaoHelper.getSysTroubleTypeList();
        troubleTypeCallBack.onGetTroubleTypeList(true, URLResponseCode.ErrorCode.SUCCESS_OFFLINE, "", troubleTypeBeans);
    }

    @Override
    public void getTroubleRiskLevelList(Context context, int pageindex, int pagesize, TroubleTypeCallBack troubleTypeCallBack) {
        List<TroubleRiskLevelBean> levelBeans = dbDaoHelper.getSysTroubleLevelList();
        troubleTypeCallBack.onGetTroubleRiskLevelList(true, URLResponseCode.ErrorCode.SUCCESS_OFFLINE, "", levelBeans);
    }

    @Override
    public void getPipeTypeList(Context context, int pageindex, int pagesize, TroubleTypeCallBack troubleTypeCallBack) {
        List<PipeTypeBean> pipeTypeBeans = dbDaoHelper.getPipeTypeList();
        troubleTypeCallBack.onGetPipeTypeList(true, URLResponseCode.ErrorCode.SUCCESS_OFFLINE, "", pipeTypeBeans);
    }
}
