-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
561 additions
and
74 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
data/src/main/java/com/d83t/bpm/data/model/response/UserScheduleResponse.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 com.d83t.bpm.data.model.response | ||
|
||
import com.d83t.bpm.data.base.BaseResponse | ||
import com.d83t.bpm.data.mapper.DataMapper | ||
import com.d83t.bpm.domain.model.UserSchedule | ||
import com.google.gson.annotations.SerializedName | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
data class UserScheduleResponse( | ||
@SerializedName("studioName") | ||
val studioName: String?, | ||
@SerializedName("date") | ||
val date: String?, | ||
@SerializedName("time") | ||
val time: String?, | ||
@SerializedName("memo") | ||
val memo: String?, | ||
) : BaseResponse { | ||
companion object : DataMapper<UserScheduleResponse, UserSchedule> { | ||
override fun UserScheduleResponse.toDataModel(): UserSchedule { | ||
return UserSchedule( | ||
studioName = studioName, | ||
date = date, | ||
time = time, | ||
memo = memo | ||
) | ||
} | ||
} | ||
} |
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
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
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/d83t/bpm/domain/model/UserSchedule.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,12 @@ | ||
package com.d83t.bpm.domain.model | ||
|
||
import com.d83t.bpm.domain.base.BaseModel | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
data class UserSchedule( | ||
val studioName: String? = "", | ||
val date: String? = "", | ||
val time: String? = "", | ||
val memo: String? = "끝까지 화이팅!", | ||
) : BaseModel |
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
17 changes: 17 additions & 0 deletions
17
domain/src/main/java/com/d83t/bpm/domain/usecase/main/GetUserScheduleUseCase.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,17 @@ | ||
package com.d83t.bpm.domain.usecase.main | ||
|
||
import com.d83t.bpm.domain.model.ResponseState | ||
import com.d83t.bpm.domain.model.UserSchedule | ||
import com.d83t.bpm.domain.repository.MainRepository | ||
import dagger.Reusable | ||
import javax.inject.Inject | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
@Reusable | ||
class GetUserScheduleUseCase @Inject constructor( | ||
private val mainRepository: MainRepository | ||
) { | ||
suspend operator fun invoke(): Flow<ResponseState<UserSchedule>> { | ||
return mainRepository.getUserSchedule() | ||
} | ||
} |
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
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
44 changes: 44 additions & 0 deletions
44
presentation/src/main/java/com/d83t/bpm/presentation/ui/main/add/MainAddBottomSheet.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,44 @@ | ||
package com.d83t.bpm.presentation.ui.main.add | ||
|
||
import androidx.fragment.app.viewModels | ||
import com.d83t.bpm.presentation.R | ||
import com.d83t.bpm.presentation.base.BaseBottomSheetFragment | ||
import com.d83t.bpm.presentation.databinding.BottomsheetMainAddBinding | ||
import com.d83t.bpm.presentation.util.repeatCallDefaultOnStarted | ||
import com.d83t.bpm.presentation.util.showToast | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class MainAddBottomSheet : | ||
BaseBottomSheetFragment<BottomsheetMainAddBinding>(BottomsheetMainAddBinding::inflate) { | ||
|
||
override fun getTheme(): Int = R.style.DdoreumBottomSheetDialog | ||
|
||
override val viewModel: MainAddViewModel by viewModels() | ||
|
||
override fun initLayout() { | ||
bind { | ||
vm = viewModel | ||
lifecycleOwner = viewLifecycleOwner | ||
} | ||
} | ||
|
||
override fun setupCollect() { | ||
repeatCallDefaultOnStarted { | ||
viewModel.event.collect { event -> | ||
when (event) { | ||
MainAddViewEvent.Click -> { | ||
requireContext().showToast("오픈 예정입니다!") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
|
||
fun newInstance(): MainAddBottomSheet { | ||
return MainAddBottomSheet() | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
presentation/src/main/java/com/d83t/bpm/presentation/ui/main/add/MainAddViewEvent.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,5 @@ | ||
package com.d83t.bpm.presentation.ui.main.add | ||
|
||
sealed interface MainAddViewEvent { | ||
object Click : MainAddViewEvent | ||
} |
24 changes: 24 additions & 0 deletions
24
presentation/src/main/java/com/d83t/bpm/presentation/ui/main/add/MainAddViewModel.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,24 @@ | ||
package com.d83t.bpm.presentation.ui.main.add | ||
|
||
import androidx.lifecycle.viewModelScope | ||
import com.d83t.bpm.presentation.base.BaseViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
import kotlinx.coroutines.flow.MutableSharedFlow | ||
import kotlinx.coroutines.flow.SharedFlow | ||
import kotlinx.coroutines.launch | ||
|
||
@HiltViewModel | ||
class MainAddViewModel @Inject constructor() : BaseViewModel() { | ||
|
||
private val _event = MutableSharedFlow<MainAddViewEvent>() | ||
val event: SharedFlow<MainAddViewEvent> | ||
get() = _event | ||
|
||
fun clickDisable() { | ||
viewModelScope.launch { | ||
_event.emit(MainAddViewEvent.Click) | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.