【发布时间】:2021-06-11 19:41:24
【问题描述】:
这就是我想要做的事情
@FormUrlEncoded
@POST("retrofit/POST/signup.php")
abstract fun signUp(
@Field(Constant().KEY_NAME) name: String?,
@Field(Constant().KEY_CELL) cell: String?,
@Field(Constant().KEY_PASSWORD) password: String?,
): Call<Contacts?>?
我在Constant().KEY_NAME、Constant().KEY_CELL、Constant().KEY_PASSWORD 上遇到错误
错误:注解参数必须是编译时常量
常量类。
class Constant {
val BASE_URL = "http://istiak.ga/app/"
val KEY_NAME = "name"
val KEY_PASSWORD = "password"
val KEY_CELL = "cell"
}
【问题讨论】: