如何在Dagger2中使用构造函数@Inject数据类

时间:2019-03-07 12:04:57

标签: android dependency-injection dagger-2

我有这个来自API的响应对象

data class ReqSpaceAvailability @Inject constructor(var stationFrom: String? = null,
                                                    var stationTo: String? = null,
                                                    var detailNumPlaces: String? = "1",
                                                    var detailTypePlaces: String? = "0",
                                                    var direction: ArrayList<ObjDirection>? = null)

但是它不是在编译

  

“错误:类型只能包含一个@Inject构造函数。”

0 个答案:

没有答案