Skip to content

Commit

Permalink
chore: 좌표 파라미터 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
JiwonKKang committed Feb 26, 2025
1 parent dd12f7d commit c30f6e4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package com.deepromeet.atcha.transit.api.request
import com.deepromeet.atcha.location.domain.Coordinate

data class TaxiFareRequest(
val originLat: Double,
val originLon: Double,
val destinationLat: Double,
val destinationLon: Double
val startLat: Double,
val startLon: Double,
val endLat: Double,
val endLon: Double
) {
fun toOriginCoordinate(): Coordinate = Coordinate(originLat, originLon)
fun toOriginCoordinate(): Coordinate = Coordinate(startLat, startLon)

fun toDestinationCoordinate(): Coordinate = Coordinate(destinationLat, destinationLon)
fun toDestinationCoordinate(): Coordinate = Coordinate(endLat, endLon)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.deepromeet.atcha.location.domain.Coordinate

interface TaxiFareFetcher {
fun fetch(
originCoordinate: Coordinate,
destinationCoordinate: Coordinate
startCoordinate: Coordinate,
endCoordinate: Coordinate
): Fare?
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class TransitService(
}

fun getTaxiFare(
originCoordinate: Coordinate,
destinationCoordinate: Coordinate
startCoordinate: Coordinate,
endCoordinate: Coordinate
): Fare {
return taxiFareFetcher.fetch(originCoordinate, destinationCoordinate)
return taxiFareFetcher.fetch(startCoordinate, endCoordinate)
?: throw TransitException.TaxiFareFetchFailed
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class KakaoTaxiFareClient(
private val kakaoRouteFeignClient: KakaoRouteFeignClient
) : TaxiFareFetcher {
override fun fetch(
originCoordinate: Coordinate,
destinationCoordinate: Coordinate
startCoordinate: Coordinate,
endCoordinate: Coordinate
): Fare? {
val response =
kakaoRouteFeignClient.getRoute(
"${originCoordinate.lon},${originCoordinate.lat}",
"${destinationCoordinate.lon},${destinationCoordinate.lat}"
"${startCoordinate.lon},${startCoordinate.lat}",
"${endCoordinate.lon},${endCoordinate.lat}"
)
return response.firstTaxiFare()
}
Expand Down

0 comments on commit c30f6e4

Please # to comment.