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 + } + /** * 初始化服务类 */