|
@@ -106,17 +106,16 @@ class AdmRepository(
|
|
|
suspend fun requestDict(request: AdmRequest) {
|
|
|
request(
|
|
|
from = { api.getDict(request) },
|
|
|
- to = { define ->
|
|
|
-
|
|
|
- val pipeConfig = define.pipeConfig
|
|
|
- val infosConfig = define.infosConfig
|
|
|
- val config = define.config
|
|
|
- val m2dTypes = define.m2dTypes
|
|
|
- val relConfig = define.relConfig
|
|
|
- val system = define.dict.system
|
|
|
- val equipment = define.dict.equipment
|
|
|
- val relation = define.dict.relation
|
|
|
- val major = define.dict.major
|
|
|
+ to = { dict ->
|
|
|
+ val pipeConfig = dict.pipeConfig
|
|
|
+ val infosConfig = dict.infosConfig
|
|
|
+ val config = dict.config
|
|
|
+ val m2dTypes = dict.m2dTypes
|
|
|
+ val relConfig = dict.relConfig
|
|
|
+ val system = dict.dict.system
|
|
|
+ val equipment = dict.dict.equipment
|
|
|
+ val relation = dict.dict.relation
|
|
|
+ val major = dict.dict.major
|
|
|
|
|
|
try {
|
|
|
db.pipeConfigDao().insConfigs(pipeConfig)
|
|
@@ -131,7 +130,8 @@ class AdmRepository(
|
|
|
} catch (e: Exception) {
|
|
|
Log.d("requestDict", e.message!!)
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ error = { println("error:$it") }
|
|
|
)
|
|
|
}
|
|
|
|
|
@@ -168,4 +168,11 @@ class AdmRepository(
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 返回楼层
|
|
|
+ */
|
|
|
+ suspend fun getFloors(): List<ObjectEntity> {
|
|
|
+ return db.objectDao().getFloors()
|
|
|
+ }
|
|
|
+
|
|
|
}
|