我有一个简单的用户数据类
data class User(@PrimaryKey(autoGenerate = true) val id: Long, val _id: String, val name: String, val about: String,
val phoneNumber: String, val token: String,
val lastLogin: String, val avatarUrl: String, @Embedded val location: Location,
val emailId: String, val gender: Boolean, val timestamp: Long = System.currentTimeMillis())
如您所见,最后一个参数是 val timestamp: Long = System.currentTimeMillis()
响应来自使用改造的网络并使用解析GSON
timestamp
没有响应 json 它只是我需要做一些逻辑的额外字段。问题是值总是0
. 它应该是当前时间戳