You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
837 B
Kotlin

package com.common.commonlibtest.manager
import com.common.commonlib.net.BaseObserve
import com.common.commonlib.net.callback.RequestCallBack
import com.common.commonlibtest.bean.LoginResponse
import io.reactivex.rxjava3.core.Observable
import okhttp3.Interceptor
import retrofit2.http.*
class LoginLoader(interceptors: List<Interceptor>) :
BaseObserve<LoginLoader.LoginApi>(LoginApi::class.java, interceptors) {
fun login(userName: String, pwd: String, callBack: RequestCallBack<LoginResponse>) {
observe(api?.login(userName, pwd), callBack)
}
interface LoginApi {
@FormUrlEncoded
@Headers("baseurl:debug1")
@POST("/user/login")
fun login(
@Field("username") userName: String,
@Field("password") pwd: String
): Observable<LoginResponse>
}
}