|
|
@ -10,11 +10,23 @@ import retrofit2.http.Headers
|
|
|
|
import retrofit2.http.Path
|
|
|
|
import retrofit2.http.Path
|
|
|
|
|
|
|
|
|
|
|
|
class CollectionLoader : BaseObserve<CollectionLoader.CollectionApi> {
|
|
|
|
class CollectionLoader : BaseObserve<CollectionLoader.CollectionApi> {
|
|
|
|
|
|
|
|
var myApi: CollectionApi? = null
|
|
|
|
|
|
|
|
var myInterceptorApi : CollectionApi? = null
|
|
|
|
|
|
|
|
|
|
|
|
constructor() : super(CollectionApi::class.java)
|
|
|
|
constructor() : super(CollectionApi::class.java)
|
|
|
|
constructor(interceptors: List<Interceptor>) : super(CollectionApi::class.java, interceptors)
|
|
|
|
constructor(interceptors: List<Interceptor>) : super(CollectionApi::class.java, interceptors)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init {
|
|
|
|
|
|
|
|
myApi = initService(CollectionApi::class.java)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun init(interceptors: List<Interceptor>) {
|
|
|
|
|
|
|
|
myApi = initService(CollectionApi::class.java)
|
|
|
|
|
|
|
|
myInterceptorApi = initService(CollectionApi::class.java, interceptors)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun getCollections(pageName: Int, callBack: RequestCallBack<CollectionResponse>) {
|
|
|
|
fun getCollections(pageName: Int, callBack: RequestCallBack<CollectionResponse>) {
|
|
|
|
observe(api?.getCollections(pageName), callBack)
|
|
|
|
observe(api.getCollections(pageName), callBack)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface CollectionApi {
|
|
|
|
interface CollectionApi {
|
|
|
|