-
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 #310 from Runnect/feature/feat-discover-my-course-…
…title [MOD] 보관함 - 내가 그린 코스 / 사용자가 설정한 제목이 표시 되도록 수정
- Loading branch information
Showing
11 changed files
with
72 additions
and
83 deletions.
There are no files selected for viewing
73 changes: 38 additions & 35 deletions
73
app/src/main/java/com/runnect/runnect/data/dto/response/ResponseGetMyDrawCourse.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,50 +1,53 @@ | ||
package com.runnect.runnect.data.dto.response | ||
|
||
import com.runnect.runnect.domain.entity.MyDrawCourse | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ResponseGetMyDrawCourse( | ||
@SerialName("data") | ||
val `data`: Data, | ||
@SerialName("message") | ||
val message: String, | ||
@SerialName("status") | ||
val status: Int, | ||
@SerialName("success") | ||
val success: Boolean, | ||
@SerialName("courses") | ||
val courses: List<Course>, | ||
@SerialName("user") | ||
val user: User, | ||
) { | ||
@Serializable | ||
data class Data( | ||
@SerialName("courses") | ||
val courses: List<Course>, | ||
@SerialName("user") | ||
val user: User, | ||
data class Course( | ||
@SerialName("createdAt") | ||
val createdAt: String, | ||
@SerialName("departure") | ||
val departure: Departure, | ||
@SerialName("id") | ||
val id: Int, | ||
@SerialName("image") | ||
val image: String, | ||
@SerialName("title") | ||
val title: String | ||
) { | ||
@Serializable | ||
data class Course( | ||
@SerialName("createdAt") | ||
val createdAt: String, | ||
@SerialName("departure") | ||
val departure: Departure, | ||
@SerialName("id") | ||
val id: Int, | ||
@SerialName("image") | ||
val image: String, | ||
) { | ||
@Serializable | ||
data class Departure( | ||
@SerialName("city") | ||
val city: String, | ||
@SerialName("region") | ||
val region: String, | ||
) | ||
} | ||
data class Departure( | ||
@SerialName("city") | ||
val city: String, | ||
@SerialName("region") | ||
val region: String, | ||
) | ||
} | ||
|
||
@Serializable | ||
data class User( | ||
@SerialName("id") | ||
val id: Int, | ||
@Serializable | ||
data class User( | ||
@SerialName("id") | ||
val id: Int, | ||
) | ||
} | ||
|
||
fun ResponseGetMyDrawCourse.toMyDrawCourse(): List<MyDrawCourse> { | ||
return this.courses.map { | ||
MyDrawCourse( | ||
courseId = it.id, | ||
image = it.image, | ||
city = it.departure.city, | ||
region = it.departure.region, | ||
title = it.title | ||
) | ||
} | ||
} |
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
22 changes: 4 additions & 18 deletions
22
app/src/main/java/com/runnect/runnect/data/repository/StorageRepositoryImpl.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
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
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: 2 additions & 2 deletions
4
app/src/main/java/com/runnect/runnect/domain/repository/StorageRepository.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,13 +1,13 @@ | ||
package com.runnect.runnect.domain.repository | ||
|
||
import com.runnect.runnect.data.dto.MyDrawCourse | ||
import com.runnect.runnect.data.dto.MyScrapCourse | ||
import com.runnect.runnect.data.dto.request.RequestPutMyDrawCourse | ||
import com.runnect.runnect.data.dto.response.ResponsePutMyDrawCourse | ||
import com.runnect.runnect.domain.entity.MyDrawCourse | ||
import retrofit2.Response | ||
|
||
interface StorageRepository { | ||
suspend fun getMyDrawCourse(): MutableList<MyDrawCourse>? | ||
suspend fun getMyDrawCourse(): Result<List<MyDrawCourse>?> | ||
suspend fun deleteMyDrawCourse(deleteCourseList: RequestPutMyDrawCourse) : Response<ResponsePutMyDrawCourse> | ||
suspend fun getMyScrapCourse(): MutableList<MyScrapCourse>? | ||
} |
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
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