desc:提供网络请求的抽象类

author:wangyimiao
master
yimiao 3 years ago
parent 3d7a82125c
commit 128e879620

@ -0,0 +1,13 @@
package com.common.commonlib.net.callback
/**
* 请求回调
*
* @author wangym
* @since 2021/7/28
*/
interface RequestCallBack<T> {
fun onResult(result: T)
fun onError(error: String?)
fun onComplete()
}

@ -0,0 +1,19 @@
package com.common.commonlib.net.callback
import com.common.commonlib.log.Logger
/**
* 不关注结果的的回调
*
* @author wangym
* @since 2021/8/2
*/
abstract class RequestNoResultCallBack<T> : RequestCallBack<T> {
override fun onResult(result: T) {
Logger.d("result ignore")
}
abstract override fun onError(error: String?)
abstract override fun onComplete()
}
Loading…
Cancel
Save