[BadCase]添加网络请求日志
This commit is contained in:
@@ -21,6 +21,7 @@ internal class BadCaseNetModel {
|
||||
.get(channel ?: "", pageNo)
|
||||
.takeIf {
|
||||
val body = it.body()
|
||||
CallerLogger.d("$M_DEVA${BadCaseManager.TAG}", "get result: $body")
|
||||
it.isSuccessful && body != null && (body.code == 0 || body.code == 200)
|
||||
}
|
||||
?.body()?.also {
|
||||
@@ -39,16 +40,19 @@ internal class BadCaseNetModel {
|
||||
}
|
||||
|
||||
suspend fun upload(map: Map<String, String>): UploadResult? = try {
|
||||
CallerLogger.d("$M_DEVA${BadCaseManager.TAG}", "upload_params:$map")
|
||||
MoGoRetrofitFactory
|
||||
.getInstance(BadCaseHost.getHost())
|
||||
.create(BadCaseApi::class.java)
|
||||
.post(map)
|
||||
.takeIf {
|
||||
val body = it.body()
|
||||
CallerLogger.d("$M_DEVA${BadCaseManager.TAG}", "upload_result:$body")
|
||||
return@takeIf it.isSuccessful && (body != null) && (body.code == 0 || body.code == 200)
|
||||
}
|
||||
?.body()
|
||||
} catch (t: Throwable) {
|
||||
CallerLogger.d("$M_DEVA${BadCaseManager.TAG}", "upload_error:$t")
|
||||
null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user