1.GSON解析:
import com.google.gson.annotations.SerializedName
public class ScheduleMessagesRequest {
@SerializedName("wedding_id")
public StringweddingId;
@SerializedName("member_id")
public StringmemeberId;
@SerializedName("sequence_id")
public StringsequenceId;
}
2. Moshi解析:
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class PasswordPayload(
@Json(name = "email")
var email: String? =null,
@Json(name = "password")
var password: String? =null,
@Json(name = "new_password")
var newPassword: String? =null,
@Json(name = "new_password_confirmation")
var confirmPassword: String? =null)
网友评论