diff --git a/commonLib/src/main/java/com/common/commonlib/net/callback/RequestCallBack.kt b/commonLib/src/main/java/com/common/commonlib/net/callback/RequestCallBack.kt new file mode 100644 index 0000000..a6f9b3f --- /dev/null +++ b/commonLib/src/main/java/com/common/commonlib/net/callback/RequestCallBack.kt @@ -0,0 +1,13 @@ +package com.common.commonlib.net.callback + +/** + * 请求回调 + * + * @author wangym + * @since 2021/7/28 + */ +interface RequestCallBack { + fun onResult(result: T) + fun onError(error: String?) + fun onComplete() +} \ No newline at end of file diff --git a/commonLib/src/main/java/com/common/commonlib/net/callback/RequestNoResultCallBack.kt b/commonLib/src/main/java/com/common/commonlib/net/callback/RequestNoResultCallBack.kt new file mode 100644 index 0000000..d1771f9 --- /dev/null +++ b/commonLib/src/main/java/com/common/commonlib/net/callback/RequestNoResultCallBack.kt @@ -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 : RequestCallBack { + override fun onResult(result: T) { + Logger.d("result ignore") + } + + abstract override fun onError(error: String?) + + abstract override fun onComplete() +}