networkCall = NetworkCall(context)
val responceCall = networkCall!!.getRetrofit(true).callReadMeService()
responceCall.clone().enqueue(object : Callback<BaseResponse<*>?> {
override fun onResponse(call: Call<BaseResponse<*>?>, response: Response<BaseResponse<*>?>) {
networkCall!!.dismissLoading()
web_view!!.loadData((response.body()?.data as LinkedTreeMap<*, *>)["description"] as String, "text/html", "UTF-8")
}
override fun onFailure(call: Call<BaseResponse<*>?>, t: Throwable) {
networkCall!!.dismissLoading()
}
})
这是api方法
@POST("stories/readme")
fun callReadMeService(): Call<BaseResponse<*>?>
现在我得到了这个例外
这是我的BaseResponse类
class BaseResponse<T> {
var message: String? = null
var status: Boolean = false
var errors: Array<String>? = null
var code: String? = null
var data: T? = null
}
方法返回类型不得包含类型变量或通配符:retrofit2.Call&gt; 对于方法IApi.callReadMeService
现在我无法从BaseResponse类中删除通用数据变量,因为我将此类用作常见的Api解析器
任何解决方案