-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #323 from Runnect/feature/fix-discover-course-uplo…
…ad-pick [FIX] 코스 발견 / 내가 그린 코스 업로드
- Loading branch information
Showing
20 changed files
with
360 additions
and
369 deletions.
There are no files selected for viewing
8 changes: 0 additions & 8 deletions
8
app/src/main/java/com/runnect/runnect/data/dto/CourseLoadInfoDTO.kt
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
app/src/main/java/com/runnect/runnect/data/dto/response/ResponseGetDiscoverPick.kt
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
app/src/main/java/com/runnect/runnect/data/dto/response/ResponseGetDiscoverUploadCourse.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,56 @@ | ||
package com.runnect.runnect.data.dto.response | ||
|
||
import com.runnect.runnect.domain.entity.DiscoverUploadCourse | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ResponseGetDiscoverUploadCourse( | ||
@SerialName("user") | ||
val user: User, | ||
@SerialName("courses") | ||
val courses: List<PrivateCourse> | ||
) { | ||
@Serializable | ||
data class User( | ||
@SerialName("id") | ||
val id: Int | ||
) | ||
|
||
@Serializable | ||
data class PrivateCourse( | ||
@SerialName("id") | ||
val id: Int, | ||
@SerialName("image") | ||
val image: String, | ||
@SerialName("createdAt") | ||
val createdAt: String, | ||
@SerialName("distance") | ||
val distance: Double, | ||
@SerialName("title") | ||
val title: String, | ||
@SerialName("departure") | ||
val departure: Departure | ||
) { | ||
@Serializable | ||
data class Departure( | ||
@SerialName("region") | ||
val region: String, | ||
@SerialName("city") | ||
val city: String, | ||
@SerialName("town") | ||
val town: String, | ||
@SerialName("name") | ||
val name: String? | ||
) | ||
} | ||
|
||
fun toUploadCourses(): List<DiscoverUploadCourse> = courses.map { course -> | ||
DiscoverUploadCourse( | ||
id = course.id, | ||
imageUrl = course.image, | ||
departure = "${course.departure.region} ${course.departure.city}", | ||
distance = course.distance.toString() | ||
) | ||
} | ||
} |
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
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
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/runnect/runnect/domain/entity/DiscoverUploadCourse.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,12 @@ | ||
package com.runnect.runnect.domain.entity | ||
|
||
import android.os.Parcelable | ||
import kotlinx.android.parcel.Parcelize | ||
|
||
@Parcelize | ||
data class DiscoverUploadCourse( | ||
val id: Int, | ||
val imageUrl: String, | ||
val departure: String, | ||
val distance: String | ||
) : Parcelable |
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
Oops, something went wrong.