riku
2025-10-27 0f58aa8ea118c3bd0b28396febc58fdbd94eef75
app/src/main/java/cn/flightfeather/thirdappmodule/repository/ProblemRepository.kt
@@ -6,6 +6,7 @@
import cn.flightfeather.thirdappmodule.bean.vo.ProblemDetailVo
import cn.flightfeather.thirdappmodule.bean.vo.ProblemlistVo
import cn.flightfeather.thirdappmodule.common.net.*
import cn.flightfeather.thirdappmodule.httpservice.DomainItemService
import cn.flightfeather.thirdappmodule.httpservice.InspectionService
import cn.flightfeather.thirdappmodule.httpservice.MediaFileService
import cn.flightfeather.thirdappmodule.httpservice.ProblemListService
@@ -39,12 +40,11 @@
    /**
     * 获取场景问题可选位置
     */
    fun getLocationList(resultCallBack: ResultCallBack<ArrayList<Domainitem>>) {
        val dbService = domainDao.getLocationList().map {
            Response.success(ArrayList<Domainitem>().apply { addAll(it) })
        }
    fun getLocationList(sceneType: Int, resultCallBack: ResultCallBack<ArrayList<Domainitem>>) {
        RetrofitFactory.executeResult(dbService, object : ResultObserver<ArrayList<Domainitem>>() {
        val service = retrofit.create(DomainItemService::class.java).getLocation(sceneType)
        RetrofitFactory.executeResult(service, object : ResultObserver<ArrayList<Domainitem>>() {
            override fun onSuccess(result: ArrayList<Domainitem>?) {
                resultCallBack.onSuccess(result)
            }
@@ -52,8 +52,22 @@
            override fun onFailure(e: Throwable, isNetWorkError: Boolean) {
                resultCallBack.onFailure()
            }
        })
//        val dbService = domainDao.getLocationList().map {
//            Response.success(ArrayList<Domainitem>().apply { addAll(it) })
//        }
//
//        RetrofitFactory.executeResult(dbService, object : ResultObserver<ArrayList<Domainitem>>() {
//            override fun onSuccess(result: ArrayList<Domainitem>?) {
//                resultCallBack.onSuccess(result)
//            }
//
//            override fun onFailure(e: Throwable, isNetWorkError: Boolean) {
//                resultCallBack.onFailure()
//            }
//
//        })
    }
    /**
@@ -78,6 +92,7 @@
     * 获取对应场景下所有问题类型
     */
    fun getProblemType(taskTypeId: Byte, cityCode: String, districtCode: String, sceneTypeId: Byte, resultCallBack: ResultCallBack<ArrayList<Problemtype>>) {
        val dbService = domainDao.getProblemType(taskTypeId, cityCode, districtCode, sceneTypeId).map {
            Response.success(ArrayList<Problemtype>().apply { addAll(it) })
        }