From 72f4d5a2bee3cf0f9fdcc47a45b39792c72cb3e0 Mon Sep 17 00:00:00 2001 From: yimiao Date: Mon, 2 Aug 2021 15:09:55 +0800 Subject: [PATCH] =?UTF-8?q?desc:=E5=8F=8C=E5=8F=82=E6=95=B0=E6=9E=84?= =?UTF-8?q?=E9=80=A0=E5=AE=9E=E7=8E=B0=E6=A0=B7=E4=BE=8B=20author:wangyimi?= =?UTF-8?q?ao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/common/commonlibtest/manager/CollectionLoader.kt | 5 +++-- .../src/main/java/com/common/commonlib/net/BaseObserve.kt | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/common/commonlibtest/manager/CollectionLoader.kt b/app/src/main/java/com/common/commonlibtest/manager/CollectionLoader.kt index fe0d949..2419757 100644 --- a/app/src/main/java/com/common/commonlibtest/manager/CollectionLoader.kt +++ b/app/src/main/java/com/common/commonlibtest/manager/CollectionLoader.kt @@ -9,8 +9,9 @@ import retrofit2.http.GET import retrofit2.http.Headers import retrofit2.http.Path -class CollectionLoader(interceptors: List) : - BaseObserve(CollectionApi::class.java, interceptors) { +class CollectionLoader : BaseObserve { + constructor() : super(CollectionApi::class.java) + constructor(interceptors: List) : super(CollectionApi::class.java, interceptors) fun getCollections(pageName: Int, callBack: RequestCallBack) { observe(api?.getCollections(pageName), callBack) diff --git a/commonLib/src/main/java/com/common/commonlib/net/BaseObserve.kt b/commonLib/src/main/java/com/common/commonlib/net/BaseObserve.kt index 0ae1745..48a85b7 100644 --- a/commonLib/src/main/java/com/common/commonlib/net/BaseObserve.kt +++ b/commonLib/src/main/java/com/common/commonlib/net/BaseObserve.kt @@ -37,6 +37,13 @@ open class BaseObserve { api = RequestManager.create(clazz, interceptors) } + /** + * 提供方法给外部获取API + */ + fun getAPI(): T? { + return api + } + /** * 初始化服务类 */