From e234a15b428267997c903a4ed42536c5d9f14a1f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 10 十一月 2025 13:10:42 +0800
Subject: [PATCH] 2025.11.10 1. 新增巡查场景历史详情相关数据逻辑; 2. 新增工地施工阶段修改界面;

---
 app/src/main/java/cn/flightfeather/thirdappmodule/repository/SearchRepository.kt |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/app/src/main/java/cn/flightfeather/thirdappmodule/repository/SearchRepository.kt b/app/src/main/java/cn/flightfeather/thirdappmodule/repository/SearchRepository.kt
index 4e1b569..bdf08bd 100644
--- a/app/src/main/java/cn/flightfeather/thirdappmodule/repository/SearchRepository.kt
+++ b/app/src/main/java/cn/flightfeather/thirdappmodule/repository/SearchRepository.kt
@@ -1,9 +1,12 @@
 package cn.flightfeather.thirdappmodule.repository
 
+import cn.flightfeather.thirdappmodule.bean.entity.Subtask
 import cn.flightfeather.thirdappmodule.common.net.NetWorkProgressListener
 import cn.flightfeather.thirdappmodule.common.net.ResultCallBack
+import cn.flightfeather.thirdappmodule.common.net.ResultObserver
 import cn.flightfeather.thirdappmodule.common.net.RetrofitFactory
 import cn.flightfeather.thirdappmodule.httpservice.SearchService
+import cn.flightfeather.thirdappmodule.model.bean.BaseResponse
 import cn.flightfeather.thirdappmodule.model.bean.ExcelConfigVo
 import io.reactivex.android.schedulers.AndroidSchedulers
 import io.reactivex.schedulers.Schedulers
@@ -16,6 +19,8 @@
  */
 class SearchRepository {
 
+    val retrofit = RetrofitFactory.instance.retrofit
+
     fun getExcel(excelConfigVo: ExcelConfigVo, resultCallBack: ResultCallBack<Response<ResponseBody>>, listener: NetWorkProgressListener? = null) {
         val service = RetrofitFactory.withProgressListeningRetrofit(listener).create(SearchService::class.java)
                 .getExcel(excelConfigVo)
@@ -27,4 +32,23 @@
                     resultCallBack.onFailure()
                 })
     }
+
+    fun searchSubtask(userId: String, keyword: String, page: Int, resultCallBack: ResultCallBack<List<Subtask>>) {
+        val service = retrofit.create(SearchService::class.java).searchSubtask(userId, keyword, page)
+
+        RetrofitFactory.executeResult(service, object : ResultObserver<BaseResponse<List<Subtask>>>() {
+            override fun onSuccess(result: BaseResponse<List<Subtask>>?) {
+                resultCallBack.onSuccess(result?.data)
+            }
+
+            override fun onPage(current: Int, total: Int) {
+                super.onPage(current, total)
+                resultCallBack.onPage(current, total)
+            }
+
+            override fun onFailure(e: Throwable, isNetWorkError: Boolean) {
+                resultCallBack.onFailure()
+            }
+        })
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3