commonMain.com.lt.lazy_people_http.call.adapter.CallAdapter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of LazyPeopleHttp-lib-jvm Show documentation
Show all versions of LazyPeopleHttp-lib-jvm Show documentation
Lazy people http, Retrofit of kmp all targets
package com.lt.lazy_people_http.call.adapter
import com.lt.lazy_people_http.config.LazyPeopleHttpConfig
import com.lt.lazy_people_http.request.RequestInfo
/**
* creator: lt 2023/6/28 [email protected]
* effect : 用于构造网络请求的返回值对象
* warning:
* [T]接口声明的返回值类型
*/
interface CallAdapter {
/**
* 是否能适配返回值,true为可以
*/
fun canItAdapt(
config: LazyPeopleHttpConfig,
info: RequestInfo,
returnTypeName: String
): Boolean
/**
* 构造返回值对象
*/
fun adapt(
config: LazyPeopleHttpConfig,
info: RequestInfo,
): T
}