12345678910111213141516171819202122232425262728293031 |
- package com.sikey.commonservice.model.database
- import com.google.gson.annotations.SerializedName
- import com.sikey.commonservice.model.http.xplora.weather.WeatherData
- data class WeatherDbDbEntity(
- @SerializedName("_id")
- var _id: Long,
- @SerializedName("city")
- var city: String? = null,
- @SerializedName("update_time")
- var update_time: String? = null,
- @SerializedName("weather_type")
- var weather_type: String? = null,
- @SerializedName("temperature_current")
- var temperature_current: String? = null,
- @SerializedName("temperature_low")
- var temperature_low: String = "0",
- @SerializedName("temperature_high")
- var temperature_high: String = "0"
- ) : BaseDbEntity() {
- fun from(info: WeatherData): WeatherDbDbEntity {
- city = info.cityName
- update_time = info.obTime ?: info.datetime
- weather_type = info.weather.code
- temperature_current = info.temp
- temperature_low = info.minTemp
- temperature_high = info.maxTemp
- return this
- }
- }
|