-
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 #27 from DOSOPT-CDS-TABLING/feat-waiting-popup-api
[feat] 이용예정/완료 API 연동
- Loading branch information
Showing
19 changed files
with
409 additions
and
105 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
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/sopt/tabling/data/model/request/RequestApplyCodeDto.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 org.sopt.tabling.data.model.request | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class RequestApplyCodeDto( | ||
@SerialName("order_id") | ||
val orderId: Int | ||
) |
30 changes: 30 additions & 0 deletions
30
app/src/main/java/org/sopt/tabling/data/model/response/ResponseApplyCodeDto.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,30 @@ | ||
package org.sopt.tabling.data.model.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ResponseApplyCodeDto( | ||
@SerialName("code") | ||
val code: Int, | ||
@SerialName("message") | ||
val message: String, | ||
@SerialName("data") | ||
val data: Data, | ||
) { | ||
@Serializable | ||
data class Data( | ||
@SerialName("order_id") | ||
val orderId: Int, | ||
@SerialName("waiting_number") | ||
val waitingNumber: Int, | ||
@SerialName("before_count") | ||
val beforeCount: Int, | ||
@SerialName("shop_name") | ||
val shopName: String, | ||
@SerialName("person_count") | ||
val personCount: Int, | ||
@SerialName("order_status") | ||
val orderStatus: String, | ||
) | ||
} |
36 changes: 36 additions & 0 deletions
36
app/src/main/java/org/sopt/tabling/data/model/response/ResponseReservationDto.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,36 @@ | ||
package org.sopt.tabling.data.model.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ResponseReservationDto( | ||
@SerialName("code") | ||
val code: Int, | ||
@SerialName("message") | ||
val message: String, | ||
@SerialName("data") | ||
val reservationList: List<Reservation>, | ||
) { | ||
@Serializable | ||
data class Reservation( | ||
@SerialName("order_id") | ||
val orderId: Int, | ||
@SerialName("order_status") | ||
val orderStatus: String, | ||
@SerialName("shop_id") | ||
val shopId: Long, | ||
@SerialName("shop_name") | ||
val shopName: String, | ||
@SerialName("order_date") | ||
val orderDate: String, | ||
@SerialName("person_count") | ||
val personCount: Int, | ||
@SerialName("waiting_number") | ||
val waitingNumber: Int, | ||
@SerialName("before_count") | ||
val beforeCount: Int, | ||
@SerialName("remaining_review_period") | ||
val remainingReviewPeriod: Int, | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/org/sopt/tabling/data/service/ApplyCodeService.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 org.sopt.tabling.data.service | ||
|
||
import org.sopt.tabling.data.model.request.RequestApplyCodeDto | ||
import org.sopt.tabling.data.model.response.ResponseApplyCodeDto | ||
import retrofit2.Call | ||
import retrofit2.http.Body | ||
import retrofit2.http.PATCH | ||
|
||
interface ApplyCodeService { | ||
@PATCH("/orders/complete") | ||
fun applyCode( | ||
@Body request: RequestApplyCodeDto, | ||
): Call<ResponseApplyCodeDto> | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/sopt/tabling/data/service/ReservationListService.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 org.sopt.tabling.data.service | ||
|
||
import org.sopt.tabling.data.model.response.ResponseReservationDto | ||
import retrofit2.Call | ||
import retrofit2.http.GET | ||
|
||
interface ReservationListService { | ||
@GET("/orders") | ||
fun getReservationList(): Call<ResponseReservationDto> | ||
} |
18 changes: 0 additions & 18 deletions
18
app/src/main/java/org/sopt/tabling/domain/model/ReservationItem.kt
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
app/src/main/java/org/sopt/tabling/presentation/common/ReservationViewModel.kt
This file was deleted.
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
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
13 changes: 7 additions & 6 deletions
13
app/src/main/java/org/sopt/tabling/presentation/queue/ReservationDoneViewHolder.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,15 +1,16 @@ | ||
package org.sopt.tabling.presentation.queue | ||
|
||
import androidx.recyclerview.widget.RecyclerView | ||
import org.sopt.tabling.data.model.response.ResponseReservationDto | ||
import org.sopt.tabling.databinding.ItemDoneReservationBinding | ||
import org.sopt.tabling.domain.model.ReservationItem | ||
|
||
class ReservationDoneViewHolder(private val binding: ItemDoneReservationBinding) : | ||
RecyclerView.ViewHolder(binding.root) { | ||
fun onBind(item: ReservationItem.ReservationDoneView) { | ||
binding.tvReservationDate.text = item.reserveDate | ||
binding.tvReservationPeople.text = item.reserveNum + "명" | ||
binding.tvStoreName.text = item.reserveName | ||
binding.tvRemainReviewNum.text = item.remainReviewNum + "일" | ||
fun onBind(item: ResponseReservationDto.Reservation) { | ||
binding.chipReservationWait.text = item.orderStatus | ||
binding.tvReservationDate.text = item.orderDate | ||
binding.tvReservationPeople.text = item.personCount.toString() + "명" | ||
binding.tvStoreName.text = item.shopName | ||
binding.tvRemainReviewNum.text = item.remainingReviewPeriod.toString() + "일" | ||
} | ||
} |
Oops, something went wrong.