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/#23] "좌석 선택 뷰", "승차권 확인 뷰" 서버통신 구현 #24

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

imtaejugkim
Copy link
Collaborator

Related issue 🛠

Work Description ✏️

  • 좌석 선택 뷰 통신 구현
  • 승차권 확인 뷰 통신 구현

Screenshot 📸

https://rumbling-chip-236.notion.site/23-14db4062d9c980f8b5d2e955a5cfe32b?pvs=4

Uncompleted Tasks 😅

  • 화면 연결 미완성

To Reviewers 📢

정리해주신 것 바탕으로 clean architecutre와 repository 구조를 이해하려고 공부했습니다! viewModel에서는 model을 따로 정의해야하는지, domain의 model을 사용해도 의존성 규칙을 지키는지 궁금합니다..! 현재 코드에서는 domain의 모델을 viewModel에서 사용중입니다.

@imtaejugkim imtaejugkim added ✨ Feat 새로운 ui 또는 기능 구현 🤢 태정 labels Nov 29, 2024
@imtaejugkim imtaejugkim self-assigned this Nov 29, 2024
Copy link
Collaborator

@gitsuhyun gitsuhyun left a comment

Choose a reason for hiding this comment

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

api 통신 방법 많이 참고했습니당 굿굿

}

LaunchedEffect(viewModel.leftSeatsState) {
snapshotFlow { viewModel.leftSeatsState.value }
Copy link
Collaborator

Choose a reason for hiding this comment

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

[3]
저는 collectAsState를 사용했는데 snapshotFlow라는 것을 사용해서 flow를 관찰할 수도 있군용

Comment on lines +106 to +107
items(seatsMapData.size) { index ->
val coach = seatsMapData[index]
Copy link
Collaborator

Choose a reason for hiding this comment

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

[3]
itemsIndexed를 사용하면 index, item을 반환할 수 있더라구요!

Comment on lines +21 to 39
private val ticketRepository: TicketRepository
) : ViewModel() {
var showDialog = mutableStateOf(false)
private var _ticketState = MutableStateFlow<TicketState>(TicketState.Idle)
val ticketState: StateFlow<TicketState> = _ticketState

val ticketDummy = TicketData(
departurePlace = "서울",
arrivalPlace = "부산",
date = "2024년 10월 30일 (수)",
trainName = "KTX 001",
departureTime = "09:30",
arrivalTime = "12:45",
seatName = "16A",
ticketPrice = 50000,
limitPaymentTime = formatDate(),
coachesNumber = 4
private val _ticketData = MutableStateFlow<TicketData>(
TicketData(
departurePlace = "",
arrivalPlace = "",
date = "",
trainName = "",
departureTime = "",
arrivalTime = "",
seatName = "",
ticketPrice = 0,
limitPaymentTime = "",
coachesNumber = 0
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[3]
참고하겠습니다!! 감사합니당ㅎㅎ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feat 새로운 ui 또는 기능 구현 🤢 태정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] "좌석 선택 뷰", "승차권 확인 뷰' api 연동
2 participants