From 128e879620ad19ec49b9429977711aa76ae0bd55 Mon Sep 17 00:00:00 2001 From: yimiao Date: Mon, 2 Aug 2021 10:59:16 +0800 Subject: [PATCH] =?UTF-8?q?desc:=E6=8F=90=E4=BE=9B=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E7=9A=84=E6=8A=BD=E8=B1=A1=E7=B1=BB=20author?= =?UTF-8?q?:wangyimiao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commonlib/net/callback/RequestCallBack.kt | 13 +++++++++++++ .../net/callback/RequestNoResultCallBack.kt | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 commonLib/src/main/java/com/common/commonlib/net/callback/RequestCallBack.kt create mode 100644 commonLib/src/main/java/com/common/commonlib/net/callback/RequestNoResultCallBack.kt 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() +}