[6.5.1]Bus考试合并到主分支

This commit is contained in:
xuxinchao
2024-07-29 16:01:09 +08:00
parent b65c5b3b23
commit fae45e0cd4
10 changed files with 143 additions and 5 deletions

View File

@@ -17,7 +17,6 @@ class StartUpTraceNetWorkModel {
.create(TraceStartUpApiService::class.java)
}
private var retryTime = 0
private var success: ((String) -> Unit)? = null
private var error: ((String) -> Unit)? = null
@Volatile
@@ -29,7 +28,8 @@ class StartUpTraceNetWorkModel {
onError: ((String) -> Unit)? = null
) {
request<BaseResponse<String>> {
var map: MutableMap<String, Any> = mutableMapOf()
var retryTime = 0
var map: MutableMap<String, Any>
start {
if (success == null) {
success = onSuccess
@@ -54,11 +54,13 @@ class StartUpTraceNetWorkModel {
onSuccess {
if (it.result != null) {
onSuccess?.invoke(it.result)
traceId = ""
} else {
if (retryTime < 3) {
retryTime += 1
report()
report(id)
} else {
traceId = ""
error?.invoke("startUp report error msg is null")
}
}
@@ -66,13 +68,13 @@ class StartUpTraceNetWorkModel {
onError {
if (retryTime < 3) {
retryTime += 1
report()
report(id)
} else if (it.message != null) {
traceId = ""
error?.invoke(it.message ?: "startUp report error msg is null")
}
}
}
}
}