Skip to content

Commit

Permalink
升级依赖版本
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenBen committed Nov 1, 2023
1 parent bcf8520 commit 3707ddd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ ext {
versions = [
'lifecycle_version' : '2.6.1',
'retrofit_version' : '2.9.0',
'okhttp3_version' : '4.11.0',
'okhttp3_version' : '4.12.0',
'moshi_version' : '1.14.0',
'koin_version' : '3.4.2',
'koin_version' : '3.5.0',
'coil_version' : '2.4.0',
'coroutines_version' : '1.7.3',
'mmkv_version' : '1.3.0',
'mmkv_version' : '1.3.1',
'fragmentation_version': '1.8.4',
'leakcanary_version' : '2.12',
'autosize_version' : '1.2.1',
Expand Down
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ afterEvaluate {
// You can then customize attributes of the publication as shown below.
groupId = 'com.shencoder'
artifactId = 'mvvmkit'
version = '1.1.6'
version = '1.1.7'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ fun BaseViewModel<*>.launchOnUIDelay(delayMillis: Long, function: () -> Unit) =
* 网络请求
* @param block 网络请求具体方法
* @param onSuccess 请求成功结果回调
* @param onFailure 请求失败结果回调(网络请求成功,但不是成功结果),一般公共的失败结果可在[DefaultHttpRequestHandle.defaultHttpRequestFailure]中处理
* @param onError 请求异常结果回调,一般公共的异常结果可在[DefaultHttpRequestHandle.defaultHttpRequestError]中处理
* @param onFailure 请求失败结果回调(网络请求成功,但不是成功结果),一般公共的失败结果可在[DefaultHttpRequestHandler.defaultHttpRequestFailure]中处理
* @param onError 请求异常结果回调,一般公共的异常结果可在[DefaultHttpRequestHandler.defaultHttpRequestError]中处理
* @param isShowLoadingDialog 是否显示LoadingDialog
* @param onComplete 整个请求流程结束回调
*/
Expand Down Expand Up @@ -66,15 +66,15 @@ fun <T> BaseViewModel<*>.httpRequest(
onSuccess(ResultStatus.onSuccess(it.getResponseData()))
} else {
//处理公共的失败事件
DefaultHttpRequestHandle.defaultHttpRequestFailure?.invoke(
DefaultHttpRequestHandler.defaultHttpRequestFailure?.invoke(
it.getResponseCode(),
it.getResponseMsg()
)
onFailure(ResultStatus.onFailure(it.getResponseCode(), it.getResponseMsg()))
}
}, {
//处理公共的异常事件
DefaultHttpRequestHandle.defaultHttpRequestError?.invoke(it)
DefaultHttpRequestHandler.defaultHttpRequestError?.invoke(it)
onError(ResultStatus.onError(it))
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ fun <T> CoroutineScope.httpRequest(
onSuccess(ResultStatus.onSuccess(it.getResponseData()))
} else {
//处理公共的失败事件
DefaultHttpRequestHandle.defaultHttpRequestFailure?.invoke(
DefaultHttpRequestHandler.defaultHttpRequestFailure?.invoke(
it.getResponseCode(),
it.getResponseMsg()
)
onFailure(ResultStatus.onFailure(it.getResponseCode(), it.getResponseMsg()))
}
}, {
//处理公共的异常事件
DefaultHttpRequestHandle.defaultHttpRequestError?.invoke(it)
DefaultHttpRequestHandler.defaultHttpRequestError?.invoke(it)
onError(ResultStatus.onError(it))
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package com.shencoder.mvvmkit.ext
* @date 2023/10/25 21:41
* @email 714081644@qq.com
*/
object DefaultHttpRequestHandle {
object DefaultHttpRequestHandler {

/**
* 默认处理公共的失败结果
Expand Down

0 comments on commit 3707ddd

Please sign in to comment.