Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 이용예정/완료 API 연동 #27

Merged
merged 7 commits into from
Dec 1, 2023
Merged

Conversation

HAJIEUN02
Copy link
Contributor

Work Description ✏️

Screenshot 📸

Uncompleted Tasks 😅

  • 없움!!

To Reviewers 📢

드디어 합세 끝..
버튼에 이미지 넣어야 되는데 지금까지 뷰에 빼먹었더라구욥
이걸 방금 전에 알아서ㅜ.ㅜ 야매로 이미지 집어넣었습니다 패딩 잔뜩 넣어서..
쩝 기기대응이 될지 모르겠어요
함 봐쥬세용!! item_none_reservation.xml 파일임미다

@HAJIEUN02 HAJIEUN02 self-assigned this Nov 30, 2023
@HAJIEUN02 HAJIEUN02 added this to the API 연동 milestone Nov 30, 2023
@HAJIEUN02 HAJIEUN02 linked an issue Nov 30, 2023 that may be closed by this pull request
7 tasks
Copy link
Contributor

@jihyunniiii jihyunniiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

서버통신 처음이라 너무 힘들었을텐데 고생 많으셨어요,,
저도 앱잼 때까지 서버통신 얘기만 들어도 어려워서 벌벌 떨구 그랬었는데,,,
저보다 충분히 더 잘 하시구 있답니당 !
서버 붙이기 어려운 뷰였는데 끝까지 열심히 해주셔서 너무 감사하구 고생했어용!
앱잼도 파이팅 !!

Comment on lines +8 to +13
@SerialName("code")
val code: Int,
@SerialName("message")
val message: String,
@SerialName("data")
val data: Data,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 api 명세서 보면 code, message, data 이 세 개는 모든 response에 동일하게 존재하는데요
그렇기 때문에 얘네를 BaseResponse로 만들어 사용할 수 있습니당
저는 BaseResponse를 이용해서 작업했어용
코드 한 번 참고해보시면 좋을 것 같네요

}

override fun onFailure(call: Call<ResponseReservationDto>, t: Throwable) {
context!!.showToast("네트워크 에러 발생")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
context!!.showToast("네트워크 에러 발생")
Log.e("network", t.message.toString())

이런 식으로 토스트 메시지를 이용하는 게 아니라 내려오는 오류 값을 로그를 통해 찍어보면 어떤 것 때문에 실패했는지 알 수 있어서 좋아요

if (response.isSuccessful) {
val data: ResponseApplyCodeDto = response.body()!!
if (response.code() == 400) {
context!!.showToast("이미 이용 완료된 주문입니다.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

나중에 요런 것도 스트링 추출이나 상수화 해주면 좋을 듯요

private val inflater by lazy { LayoutInflater.from(context) }

private var reservationList: List<ReservationItem> = emptyList()
private var reservationList: List<ResponseReservationDto.Reservation> = emptyList()

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return when (viewType) {
1 -> ReservationViewHolder(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상수화 해주면 좋겠네용 ㅋ

Comment on lines +48 to +56
if (reservationList[position].orderStatus == "이용 예정") {
return 1
} else if (reservationList[position].orderStatus == "이용 완료") {
if (reservationList[position].remainingReviewPeriod <= 0) {
return 3
}
return 2
} else {
return 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 when문을 사용한다면 가독성이 더 좋아질 것 같아오

@jihyunniiii jihyunniiii merged commit 56865e3 into develop Dec 1, 2023
1 check passed
@jihyunniiii jihyunniiii deleted the feat-waiting-popup-api branch December 1, 2023 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[feat] 이용예정/완료 API 연동
3 participants