package com.module.backstage.repo

import com.quyunshuo.androidbaseframemvvm.base.mvvm.m.BaseRepository
import com.module.pay.service.HomeApiService
import java.util.TreeMap
import javax.inject.Inject

/**
 * HomeFragment的数据仓库层
 *
 * @author Qu Yunshuo
 * @since 2021/8/5 10:59 下午
 */
class ErrorCheckFragmentRepo @Inject constructor() : BaseRepository() {

    @Inject
    lateinit var mApi: com.module.pay.service.HomeApiService

    @Inject
    lateinit var devApi: com.module.pay.service.DevService

    //    suspend fun getBanners() = request<List<BannerBean>> {
//        mApi.getBanners().run {
//            responseCodeExceptionHandler(code, msg)
//            emit(data)
//        }
//    }
     fun getData(data: TreeMap<String, String>) = request<String> {
        devApi.getData(data).run {
            emit(this)
        }

        //mApi.getData(data)
    }
}