Skip to content

Commit

Permalink
fixed json payload field name mismatch issue
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnzhou committed Jun 3, 2023
1 parent e598433 commit 1afddb6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
package com.lcl.lclmeasurementtool.model.datamodel

import kotlinx.serialization.SerialName

@kotlinx.serialization.Serializable
sealed interface BaseMeasureDataModel {
@SerialName("latitude")
var latitude: Double

@SerialName("longitude")
var longitude: Double

@SerialName("timestamp")
var timestamp: String

@SerialName("cell_id")
var cellId: String

@SerialName("device_id")
var deviceId: String

var reported: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import kotlinx.serialization.Transient
@kotlinx.serialization.Serializable
@Entity(tableName = "connectivity_table")
data class ConnectivityReportModel constructor(
@ColumnInfo(name = "latitude") override var latitude: Double,
@ColumnInfo(name = "longitude") override var longitude: Double,
@PrimaryKey @ColumnInfo(name = "time_stamp") override var timestamp: String,
override var cellId: String,
override var deviceId: String,
@ColumnInfo(name = "latitude") @SerialName("latitude") override var latitude: Double,
@ColumnInfo(name = "longitude") @SerialName("longitude") override var longitude: Double,
@PrimaryKey @ColumnInfo(name = "time_stamp") @SerialName("timestamp") override var timestamp: String,
@SerialName("cell_id") override var cellId: String,
@SerialName("device_id") override var deviceId: String,
@ColumnInfo(name = "upload_speed") @SerialName("upload_speed") var uploadSpeed: Double,
@ColumnInfo(name = "download_speed") @SerialName("download_speed") var downloadSpeed: Double,
@ColumnInfo(name = "ping") @SerialName("ping") var ping: Double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import kotlinx.serialization.Transient
@Entity(tableName = "signal_strength_table")
@kotlinx.serialization.Serializable
data class SignalStrengthReportModel(
@ColumnInfo(name = "latitude") override var latitude: Double,
@ColumnInfo(name = "longitude") override var longitude: Double,
@PrimaryKey @ColumnInfo(name = "time_stamp") override var timestamp: String,
override var cellId: String,
override var deviceId: String,
@ColumnInfo(name = "latitude") @SerialName("latitude") override var latitude: Double,
@ColumnInfo(name = "longitude") @SerialName("longitude") override var longitude: Double,
@PrimaryKey @ColumnInfo(name = "time_stamp") @SerialName("timestamp") override var timestamp: String,
@SerialName("cell_id") override var cellId: String,
@SerialName("device_id") override var deviceId: String,
@SerialName("dbm") @ColumnInfo(name = "signal_strength") var dbm: Int,
@SerialName("level_code") @ColumnInfo(name = "signal_strength_level") var levelCode: Int,
@ColumnInfo("reported") @Transient override var reported: Boolean = false
Expand Down

0 comments on commit 1afddb6

Please sign in to comment.