-
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.
[feat/#23] 좌석 선택 뷰 repository 와 주입 정의
- Loading branch information
1 parent
47e0053
commit 43deceb
Showing
10 changed files
with
71 additions
and
39 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
8 changes: 3 additions & 5 deletions
8
...urceimpl/LeftSeatsRemoteDataSourceImpl.kt → ...tasourceimpl/SeatsRemoteDataSourceImpl.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
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/sopt/korailtalk/data/repositoryimpl/SeatsRepositoryImpl.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,21 @@ | ||
package com.sopt.korailtalk.data.repositoryimpl | ||
|
||
import com.sopt.korailtalk.data.remote.datasource.LeftSeatsRemoteDataSource | ||
import javax.inject.Inject | ||
|
||
class SeatsRepositoryImpl @Inject constructor( | ||
private val seatsRemoteDataSource: LeftSeatsRemoteDataSource | ||
) : PaymentRepository { | ||
override suspend fun getLpoint(userId: Long, pointPassword: Int): Result<LPoint> { | ||
return runCatching { | ||
paymentRemoteDataSource.getLpoint(userId = userId, pointPassword = pointPassword) | ||
.handleApiResponse().getOrThrow().toDomain() | ||
} | ||
} | ||
|
||
override suspend fun buyTicket(ticketBuying: TicketBuying): Result<Unit> { | ||
return runCatching { | ||
paymentRemoteDataSource.buyTicket(ticketBuyingRequestDto = ticketBuying.toData()) | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/sopt/korailtalk/domain/model/SeatSelecting.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
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/sopt/korailtalk/domain/repository/SeatsRepository.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.sopt.korailtalk.domain.repository | ||
|
||
import com.sopt.korailtalk.domain.model.LeftSeats | ||
import com.sopt.korailtalk.domain.model.SeatSelecting | ||
|
||
interface SeatsRepository { | ||
suspend fun getLeftSeats(userId: Long, timetableId: Long): Result<LeftSeats> | ||
suspend fun selectSeat(seatSelecting: SeatSelecting): Result<Unit> | ||
} |
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
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/sopt/korailtalk/presentation/ui/seatmap/LeftSeatsState.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.sopt.korailtalk.presentation.ui.seatmap | ||
|
||
import com.sopt.korailtalk.domain.model.LeftSeats | ||
|
||
sealed class LeftSeatsState { | ||
data object Idle: LeftSeatsState() | ||
data object Loading: LeftSeatsState() | ||
data class Success(val data: LeftSeats): LeftSeatsState() | ||
data class Failure(val message: String): LeftSeatsState() | ||
} |