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/#68] 투두 전체 조회 / 서버통신 구현 #74

Merged
merged 19 commits into from
Jan 10, 2024

Conversation

Marchbreeze
Copy link
Member

@Marchbreeze Marchbreeze commented Jan 10, 2024

⛳️ Work Description

  • data 모듈 설정
  • domain 모듈 설정
  • di 설정
  • 아워 & 미완료 설정
  • 아워 & 완료 설정
  • 마이 & 미완료 설정
  • 마이 & 완료 설정
  • 바텀시트 날짜 오류 수정
  • 뷰페이저에 overScroll 해제 (중복 스크롤 이슈로 버벅이는듯)

📸 Screenshot

KakaoTalk_Video_2024-01-11-08-46-15.mp4

📢 To Reviewers

  • 서버통신 화이팅

@Marchbreeze Marchbreeze added 상호 🍀 FEAT ✨ 새로운 기능 구현 labels Jan 10, 2024
@Marchbreeze Marchbreeze self-assigned this Jan 10, 2024
@Marchbreeze Marchbreeze requested review from crownjoe and removed request for sjk4618 January 10, 2024 23:45
@Marchbreeze Marchbreeze changed the title [FEAT/#68] 아워, 마이투두 리스트 / 서버통신 구현 [FEAT/#68] 투두 전체 조회 / 서버통신 구현 Jan 10, 2024
Copy link
Member

@leeeyubin leeeyubin 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 +32 to +35

fun toTodoModel() =
TodoModel(todoId, title, endDate, allocators.map { it.toTodoAllocatorModel() }, secret)
}
Copy link
Member

Choose a reason for hiding this comment

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

좋습니다!!!

Comment on lines +46 to +47

fun getCompleteTodoListFromServer(tripId: Long, category: String, progress: String) {
Copy link
Member

Choose a reason for hiding this comment

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

네이밍 자세한 거 좋습니당

Comment on lines +59 to +61
private fun observeTodoListState() {
viewModel.todoCompleteListState.flowWithLifecycle(lifecycle).onEach { state ->
when (state) {
Copy link
Member

Choose a reason for hiding this comment

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

flowWithLifecycle 조아여

Copy link
Contributor

@crownjoe crownjoe left a comment

Choose a reason for hiding this comment

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

아 코드 미쳤네욥

굿뜨. 따봉.

-오전 8시 53분

Comment on lines 32 to +40
@Singleton
fun provideSettingDataSource(settingDataSourceImpl: SettingDataSourceImpl): SettingDataSource =
settingDataSourceImpl

@Provides
@Singleton
fun provideTodoDataSource(todoDataSourceImpl: TodoDataSourceImpl): TodoDataSource =
todoDataSourceImpl

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 59 to 62
private fun setViewPager() {
binding.vpMyTodo.adapter = MyTodoViewPagerAdapter(this)
binding.vpMyTodo.isUserInputEnabled = false
TabLayoutMediator(binding.tabMyTodo, binding.vpMyTodo) { tab, pos ->
Copy link
Contributor

@crownjoe crownjoe Jan 10, 2024

Choose a reason for hiding this comment

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

우와 스와이프 막는 코드.. 뷰페이저 조아요~

Comment on lines +23 to +24
private val _todoUncompleteListState = MutableStateFlow<UiState<List<TodoModel>>>(UiState.Empty)
val todoUncompleteListState: StateFlow<UiState<List<TodoModel>>> = _todoUncompleteListState
Copy link
Contributor

Choose a reason for hiding this comment

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

Uistate 좋아여~

Comment on lines +33 to +64
fun getUncompleteTodoListFromServer(tripId: Long, category: String, progress: String) {
_todoUncompleteListState.value = UiState.Loading
viewModelScope.launch {
todoRepository.getTodoList(tripId, category, progress)
.onSuccess { response ->
_todoUncompleteListState.value = UiState.Success(response)
_totalUncompletedTodoCount.value = response.size
}
.onFailure {
_todoUncompleteListState.value = UiState.Failure(it.message.orEmpty())
}
}
}

fun getCompleteTodoListFromServer(tripId: Long, category: String, progress: String) {
_todoCompleteListState.value = UiState.Loading
viewModelScope.launch {
todoRepository.getTodoList(tripId, category, progress)
.onSuccess { response ->
_todoCompleteListState.value = UiState.Success(response)
}
.onFailure {
_todoCompleteListState.value = UiState.Failure(it.message.orEmpty())
}
}
}

companion object {
const val MY_TODO = "my"
const val UNCOMPLETE = "incomplete"
const val COMPLETE = "complete"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

...서버통신 코드...장난 아니네요 조아여~

@Marchbreeze Marchbreeze merged commit f360510 into develop Jan 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT ✨ 새로운 기능 구현 상호 🍀
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 투두 전체 조회 / 서버통신 구현
3 participants