package com.common.commonlibtest.manager

import com.common.commonlib.net.BaseObserve
import com.common.commonlib.net.callback.RequestCallBack
import com.common.commonlibtest.bean.CollectionResponse
import io.reactivex.rxjava3.core.Observable
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Path

class CollectionLoader : BaseObserve<CollectionLoader.CollectionApi>(CollectionApi::class.java) {

    fun getCollections(pageName: Int, callBack: RequestCallBack<CollectionResponse>) {
        observe(api.getCollections(pageName), callBack)
    }

    interface CollectionApi {
        @Headers("baseurl:debug1")
        @GET("/lg/collect/list/{pageNum}/json")
        fun getCollections(@Path("pageNum") pageNum: Int): Observable<CollectionResponse>
    }

    override fun getType(): String {
        return LoaderType.LOGIN.type
    }
}