Skip to content

Commit

Permalink
[mod] #117 API 중 teamId 더미데이터 부분 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Doreminwoo committed Jan 12, 2024
1 parent 8aa7f1b commit 6e1e4a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.sopt.pingle.presentation.type.CategoryType
fun PinEntity.toMarkerModel(): MarkerModel {
val markerModel = MarkerModel(
Marker().apply {
position = LatLng(x, y)
position = LatLng(y, x)
isHideCollidedMarkers = true
icon = CategoryType.fromString(category).toMarkerIcon(false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package org.sopt.pingle.presentation.ui.main.home.map
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import org.sopt.pingle.data.datasource.local.PingleLocalDataSource
import org.sopt.pingle.domain.model.PinEntity
import org.sopt.pingle.domain.model.PingleEntity
import org.sopt.pingle.domain.usecase.GetPinListWithoutFilteringUseCase
Expand All @@ -18,9 +18,11 @@ import org.sopt.pingle.domain.usecase.PostPingleJoinUseCase
import org.sopt.pingle.presentation.model.MarkerModel
import org.sopt.pingle.presentation.type.CategoryType
import org.sopt.pingle.util.view.UiState
import javax.inject.Inject

@HiltViewModel
class MapViewModel @Inject constructor(
private val localStorage: PingleLocalDataSource,
private val getPinListWithoutFilteringUseCase: GetPinListWithoutFilteringUseCase,
private val getPingleListUseCase: GetPingleListUseCase,
private val postPingleJoinUseCase: PostPingleJoinUseCase,
Expand Down Expand Up @@ -95,7 +97,7 @@ class MapViewModel @Inject constructor(
_pinEntityListState.value = UiState.Loading
runCatching {
getPinListWithoutFilteringUseCase(
teamId = TEAM_ID,
teamId = localStorage.groupId.toLong(),
category = category.value?.name
).collect() { pinList ->
_pinEntityListState.value = UiState.Success(pinList)
Expand All @@ -111,7 +113,7 @@ class MapViewModel @Inject constructor(
_pingleListState.emit(UiState.Loading)
runCatching {
getPingleListUseCase(
teamId = TEAM_ID,
teamId = localStorage.groupId.toLong(),
pinId = pinId
).collect() { pingleList ->
_pingleListState.emit(UiState.Success(Pair(pinId, pingleList)))
Expand Down Expand Up @@ -154,6 +156,5 @@ class MapViewModel @Inject constructor(

companion object {
const val DEFAULT_SELECTED_MARKER_POSITION = -1
const val TEAM_ID = 1L
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
import org.sopt.pingle.data.datasource.local.PingleLocalDataSource
import org.sopt.pingle.data.datasourceimpl.local.PingleLocalDataSourceImpl
import org.sopt.pingle.domain.model.PlanLocationEntity
import org.sopt.pingle.domain.model.PlanMeetingEntity
import org.sopt.pingle.domain.model.UserInfoEntity
Expand All @@ -27,6 +29,7 @@ import org.sopt.pingle.util.view.UiState

@HiltViewModel
class PlanViewModel @Inject constructor(
private val localStorage: PingleLocalDataSource,
private val getPlanLocationListUseCase: GetPlanLocationListUseCase,
private val postPlanMeetingUseCase: PostPlanMeetingUseCase,
private val getUserInfoUseCase: GetUserInfoUseCase
Expand Down Expand Up @@ -200,7 +203,7 @@ class PlanViewModel @Inject constructor(
_selectedLocation.value?.let { selectedLocation ->
_selectedRecruitment.value?.let { selectedRecruitment ->
postPlanMeetingUseCase(
teamId = TEAM_ID,
teamId = localStorage.groupId,
planMeetingEntity = PlanMeetingEntity(
category = selectedCategory.name,
name = planTitle.value,
Expand Down Expand Up @@ -243,6 +246,5 @@ class PlanViewModel @Inject constructor(
const val FIRST_PAGE_POSITION = 0
const val DEFAULT_OLD_POSITION = -1
const val INVALID_RECRUIT = "1"
const val TEAM_ID = 1
}
}

0 comments on commit 6e1e4a4

Please sign in to comment.