Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FO-905] (모집) 지역 시군구 api response 변경 #405

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ class LocationService(
) {
@Transactional(readOnly = true)
suspend fun retrieveRegions(): RetrieveRegionsResponse {
return RetrieveRegionsResponse(locationRepository.getAllRegions())
val result = locationRepository.getAllRegions()
return RetrieveRegionsResponse(
result = result,
regions = result
)
}

@Transactional(readOnly = true)
suspend fun retrieveDistricts(region: String): RetrieveDistrictsResponse {
return RetrieveDistrictsResponse(locationRepository.getDistricts(region))
val result = locationRepository.getDistricts(region)
return RetrieveDistrictsResponse(
result = result,
district = result
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ import io.swagger.v3.oas.annotations.media.Schema

class LocationDto {
data class RetrieveRegionsResponse(
@Schema(description = "지역", example = "서울특별시")
@Schema(description = "지역 (deprecated 예정)", example = "서울특별시")
val result: List<String>,

@Schema(description = "지역", example = "서울특별시")
val regions: List<String>,
)

data class RetrieveDistrictsResponse(
@Schema(description = "시군구", example = "강남구")
@Schema(description = "시군구 (deprecated 예정)", example = "강남구")
val result: List<String>,

@Schema(description = "시군구", example = "강남구")
val district: List<String>,
)
}
Loading