[6.2.4] fix bug of request in main thread

This commit is contained in:
zhongchao
2023-12-05 14:29:54 +08:00
parent d716b618a7
commit 5b40018700
11 changed files with 37 additions and 150 deletions

View File

@@ -29,22 +29,20 @@ class AiCloudIdentifyNetWorkModel private constructor() {
onError: ((String) -> Unit)
) {
request<BaseResponse<Any>> {
val map = mutableMapOf<String, Any>()
start {
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["status"] = dataReceive
map["startMetre"] = START_METRE
map["endMetre"] = END_METRE
map["type"] = 1
if (lon != 0.0) {
map["lon"] = lon
}
if (lat != 0.0) {
map["lat"] = lat
}
}
loader {
apiCall {
val map = mutableMapOf<String, Any>()
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["status"] = dataReceive
map["startMetre"] = START_METRE
map["endMetre"] = END_METRE
map["type"] = 1
if (lon != 0.0) {
map["lon"] = lon
}
if (lat != 0.0) {
map["lat"] = lat
}
getNetWorkApi().identifyRange(map)
}
}