File tree Expand file tree Collapse file tree 4 files changed +5
-7
lines changed
domain/src/main/java/com/stop/domain/usecase/route
presentation/src/main/java/com/stop/ui/route Expand file tree Collapse file tree 4 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ internal class GetLastTransportTimeUseCaseImpl @Inject constructor(
20
20
21
21
private val allowedSubwayLineForUse = (SUBWAY_LINE_ONE .. SUBWAY_LINE_EIGHT )
22
22
23
- override suspend fun invoke (itinerary : Itinerary ): List <String ?> {
23
+ override suspend operator fun invoke (itinerary : Itinerary ): List <String ?> {
24
24
var transportIdRequests: List <TransportIdRequest ?> = createTransportIdRequests(itinerary)
25
25
transportIdRequests = convertStationId(transportIdRequests)
26
26
transportIdRequests = convertRouteId(transportIdRequests)
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ import com.stop.domain.model.route.tmap.RouteRequest
5
5
6
6
interface GetRouteUseCase {
7
7
8
- suspend fun invoke (routeRequest : RouteRequest ): List <Itinerary >
8
+ suspend operator fun invoke (routeRequest : RouteRequest ): List <Itinerary >
9
9
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ internal class GetRouteUseCaseImpl @Inject constructor(
10
10
private val routeRepository : RouteRepository
11
11
) : GetRouteUseCase {
12
12
13
- override suspend fun invoke (routeRequest : RouteRequest ): List <Itinerary > {
13
+ override suspend operator fun invoke (routeRequest : RouteRequest ): List <Itinerary > {
14
14
val originItineraries = routeRepository.getRoute(routeRequest)
15
15
16
16
return originItineraries.fold(listOf ()) itinerary@{ itineraries, itinerary ->
Original file line number Diff line number Diff line change @@ -63,16 +63,14 @@ class RouteViewModel @Inject constructor(
63
63
)
64
64
65
65
viewModelScope.launch(Dispatchers .IO ) {
66
- _routeResponse .postValue(getRouteUseCase.invoke (routeRequest))
66
+ this @RouteViewModel. _routeResponse .postValue(getRouteUseCase(routeRequest))
67
67
}
68
68
}
69
69
70
70
fun calculateLastTransportTime (itinerary : Itinerary ) {
71
71
checkClickedItinerary(itinerary)
72
72
viewModelScope.launch(Dispatchers .IO ) {
73
- val lastTimeInfo = getLastTransportTimeUseCase(itinerary)
74
-
75
- _lastTimeResponse .postValue(lastTimeInfo)
73
+ this @RouteViewModel._lastTimeResponse .postValue(getLastTransportTimeUseCase(itinerary))
76
74
}
77
75
}
78
76
You can’t perform that action at this time.
0 commit comments