@@ -78,7 +78,7 @@ internal class GetLastTransportTimeUseCaseImpl @Inject constructor(
78
78
79
79
80
80
// 고유 번호로 승차지의 막차 시간 모두 알아내기
81
- val dataWithLastTime: List <String > = transportIdRequests.map { transportIdRequest ->
81
+ val dataWithLastTime: List <Int > = transportIdRequests.map { transportIdRequest ->
82
82
when (transportIdRequest.transportMoveType) {
83
83
TransportMoveType .BUS -> getBusLastTransportTime(transportIdRequest)
84
84
TransportMoveType .SUBWAY -> getSubwayLastTransportTime(transportIdRequest)
@@ -90,20 +90,25 @@ internal class GetLastTransportTimeUseCaseImpl @Inject constructor(
90
90
return null
91
91
}
92
92
93
- private fun getSubwayLastTransportTime (transportIdRequest : TransportIdRequest ): String {
93
+ private fun getSubwayLastTransportTime (transportIdRequest : TransportIdRequest ): Int {
94
94
TODO ()
95
95
}
96
96
97
- private suspend fun getBusLastTransportTime (transportIdRequest : TransportIdRequest ): String {
97
+ private suspend fun getBusLastTransportTime (transportIdRequest : TransportIdRequest ): Int {
98
98
when (transportIdRequest.area) {
99
99
Area .GYEONGGI -> {
100
100
TODO ()
101
101
}
102
102
Area .SEOUL -> {
103
- return routeRepository.getSeoulBusLastTime(
103
+ val lastTime = routeRepository.getSeoulBusLastTime(
104
104
transportIdRequest.stationId,
105
105
transportIdRequest.lineId
106
- )
106
+ ).toInt()
107
+
108
+ if (lastTime < MID_NIGHT ) {
109
+ return lastTime + MID_NIGHT
110
+ }
111
+ return lastTime
107
112
}
108
113
Area .UN_SUPPORT_AREA -> {
109
114
TODO ()
@@ -274,5 +279,7 @@ internal class GetLastTransportTimeUseCaseImpl @Inject constructor(
274
279
275
280
private const val SUBWAY_LINE_ONE = 1
276
281
private const val SUBWAY_LINE_EIGHT = 8
282
+
283
+ private const val MID_NIGHT = 240_000
277
284
}
278
285
}
0 commit comments