-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT/#73] 여행 대시 보드 뷰 / 서버 통신 구현
- Loading branch information
Showing
44 changed files
with
622 additions
and
270 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
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
12 changes: 12 additions & 0 deletions
12
data/src/main/java/com/going/data/datasource/DashBoardDataSource.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.going.data.datasource | ||
|
||
import com.going.data.dto.BaseResponse | ||
import com.going.data.dto.response.DashBoardResponseDto | ||
|
||
interface DashBoardDataSource { | ||
|
||
suspend fun getTripList( | ||
progress: String | ||
): BaseResponse<DashBoardResponseDto> | ||
|
||
} |
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
16 changes: 16 additions & 0 deletions
16
data/src/main/java/com/going/data/datasourceImpl/DashBoardDataSourceImpl.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,16 @@ | ||
package com.going.data.datasourceImpl | ||
|
||
import com.going.data.datasource.DashBoardDataSource | ||
import com.going.data.dto.BaseResponse | ||
import com.going.data.dto.response.DashBoardResponseDto | ||
import com.going.data.service.DashBoardService | ||
import javax.inject.Inject | ||
|
||
class DashBoardDataSourceImpl @Inject constructor( | ||
private val dashBoardService: DashBoardService | ||
) : DashBoardDataSource { | ||
|
||
override suspend fun getTripList(progress: String): BaseResponse<DashBoardResponseDto> = | ||
dashBoardService.getTripList(progress) | ||
|
||
} |
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
37 changes: 37 additions & 0 deletions
37
data/src/main/java/com/going/data/dto/response/DashBoardResponseDto.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,37 @@ | ||
package com.going.data.dto.response | ||
|
||
import com.going.domain.entity.response.DashBoardModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class DashBoardResponseDto( | ||
@SerialName("name") | ||
val name: String, | ||
@SerialName("trips") | ||
val trips: List<TripsResponseDto> | ||
|
||
) { | ||
@Serializable | ||
data class TripsResponseDto( | ||
@SerialName("tripId") | ||
val tripId: Long, | ||
@SerialName("title") | ||
val title: String, | ||
@SerialName("startDate") | ||
val startDate: String, | ||
@SerialName("endDate") | ||
val endDate: String, | ||
@SerialName("day") | ||
val day: Int | ||
) { | ||
fun toTripsModel() = | ||
DashBoardModel.DashBoardTripModel(tripId, title, startDate, endDate, day) | ||
} | ||
|
||
fun toDashBoardModel() = | ||
DashBoardModel(name, trips.map { | ||
it.toTripsModel() | ||
}) | ||
} | ||
|
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
19 changes: 19 additions & 0 deletions
19
data/src/main/java/com/going/data/repositoryImpl/DashBoardRepositoryImpl.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,19 @@ | ||
package com.going.data.repositoryImpl | ||
|
||
import com.going.data.datasource.DashBoardDataSource | ||
import com.going.domain.entity.response.DashBoardModel | ||
import com.going.domain.repository.DashBoardRepository | ||
import javax.inject.Inject | ||
|
||
class DashBoardRepositoryImpl @Inject constructor( | ||
private val dashBoardSource: DashBoardDataSource | ||
) : DashBoardRepository { | ||
|
||
override suspend fun getDashBoardList( | ||
progress: String | ||
): Result<DashBoardModel> = | ||
runCatching { | ||
dashBoardSource.getTripList(progress).data.toDashBoardModel() | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
data/src/main/java/com/going/data/service/DashBoardService.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,15 @@ | ||
package com.going.data.service | ||
|
||
import com.going.data.dto.BaseResponse | ||
import com.going.data.dto.response.DashBoardResponseDto | ||
import retrofit2.http.GET | ||
import retrofit2.http.Query | ||
|
||
interface DashBoardService { | ||
|
||
@GET("api/trips") | ||
suspend fun getTripList( | ||
@Query("progress") progress: String | ||
) : BaseResponse<DashBoardResponseDto> | ||
|
||
} |
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
7 changes: 0 additions & 7 deletions
7
domain/src/main/kotlin/com/going/domain/entity/response/CompletedListModel.kt
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
domain/src/main/kotlin/com/going/domain/entity/response/DashBoardModel.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,14 @@ | ||
package com.going.domain.entity.response | ||
|
||
data class DashBoardModel( | ||
val name: String, | ||
val trips: List<DashBoardTripModel> | ||
){ | ||
data class DashBoardTripModel( | ||
val tripId: Long, | ||
val title: String, | ||
val startDate: String, | ||
val endDate: String, | ||
val day: Int | ||
) | ||
} |
8 changes: 0 additions & 8 deletions
8
domain/src/main/kotlin/com/going/domain/entity/response/OngoingListModel.kt
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
domain/src/main/kotlin/com/going/domain/repository/DashBoardRepository.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,9 @@ | ||
package com.going.domain.repository | ||
|
||
import com.going.domain.entity.response.DashBoardModel | ||
|
||
interface DashBoardRepository { | ||
suspend fun getDashBoardList( | ||
progress : String, | ||
) : Result<DashBoardModel> | ||
} |
Oops, something went wrong.