-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#18 운전 기록 전송 - LatLng 클래스 대신 Location 클래스, http logging
- Loading branch information
Showing
9 changed files
with
225 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
275 changes: 155 additions & 120 deletions
275
app/src/main/java/com/comye1/dontsleepdriver/DSDActivity.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 31 additions & 7 deletions
38
app/src/main/java/com/comye1/dontsleepdriver/data/model/DrivingBody.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,36 @@ | ||
package com.comye1.dontsleepdriver.data.model | ||
|
||
import com.google.android.gms.maps.model.LatLng | ||
|
||
data class DrivingBody( | ||
val startTime: String, | ||
val endTime: String, | ||
val totalTime: Int, | ||
val gpsData: List<LatLng>, | ||
val gpsLevel: List<Int>, | ||
val avgSleepLevel: Double | ||
) | ||
val gpsData: Array<Location>, | ||
val gpsLevel: Array<Int>, | ||
val avgSleepLevel: Double, | ||
val totalTime: Int | ||
) { | ||
override fun equals(other: Any?): Boolean { | ||
if (this === other) return true | ||
if (javaClass != other?.javaClass) return false | ||
|
||
other as DrivingBody | ||
|
||
if (startTime != other.startTime) return false | ||
if (endTime != other.endTime) return false | ||
if (!gpsData.contentEquals(other.gpsData)) return false | ||
if (!gpsLevel.contentEquals(other.gpsLevel)) return false | ||
if (avgSleepLevel != other.avgSleepLevel) return false | ||
if (totalTime != other.totalTime) return false | ||
|
||
return true | ||
} | ||
|
||
override fun hashCode(): Int { | ||
var result = startTime.hashCode() | ||
result = 31 * result + endTime.hashCode() | ||
result = 31 * result + gpsData.contentHashCode() | ||
result = 31 * result + gpsLevel.contentHashCode() | ||
result = 31 * result + avgSleepLevel.hashCode() | ||
result = 31 * result + totalTime | ||
return result | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/comye1/dontsleepdriver/data/model/DrivingData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.comye1.dontsleepdriver.data.model | ||
|
||
data class DrivingData( | ||
val id: Int, | ||
val startTime: String, | ||
val endTime: String, | ||
val avgSleepLevel: Double, | ||
val totalTime: Int, | ||
val driverId: Int | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
app/src/main/java/com/comye1/dontsleepdriver/data/model/DrivingResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/comye1/dontsleepdriver/data/model/Location.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.comye1.dontsleepdriver.data.model | ||
|
||
data class Location( | ||
val lat: Double, | ||
val lng: Double | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters