首页 > 解决方案 > How to add retrofit service interface function paramter to data class member using moshi?

问题描述

I want to add the parameter of the retrofit service interface to my data class member using moshi.

Here the interface code:

@GET("/data")
interface getData(@Query("model") model: String) : Response

Here data class

data class Datum(
   val model: String, // want to add this from the interface params
   ....
   // futher members get values from json response (using moshi)
   ...

)

is there any way to do this using moshi? is there any moshi annonation for doing this?

标签: kotlinretrofit2moshi

解决方案


推荐阅读