Skip to content

Commit

Permalink
[DPMBE-108] 지역 키워드 검색시 검색 제한 해제한다
Browse files Browse the repository at this point in the history
* feat : 검색제한을 10개로 변경

* refactor : test parameter 변경
query, display -> display, query
  • Loading branch information
BlackBean99 committed Jul 10, 2023
1 parent ecc7b40 commit 8158ad5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.depromeet.whatnow.annotation.Helper
import com.depromeet.whatnow.api.NcpLocalSearchClient
import com.depromeet.whatnow.api.dto.NcpMapInfoResponse
import com.depromeet.whatnow.config.NcpProperties
import com.depromeet.whatnow.consts.NCP_LOCAL_SEARCH_DISPLAY_COUNT

@Helper
class NcpHelper(
Expand All @@ -14,6 +15,6 @@ class NcpHelper(

// 검색 키워드 조회
fun getLocalSearch(keyword: String): NcpMapInfoResponse {
return ncpClient.searchByKeyword(ncpPropertie.accessKey, ncpPropertie.secretKey, keyword)
return ncpClient.searchByKeyword(ncpPropertie.accessKey, ncpPropertie.secretKey, NCP_LOCAL_SEARCH_DISPLAY_COUNT, keyword)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const val WITHDRAW_PREFIX = "withdraw"
const val RADIUS_WAIT_CONFIRM = 200
const val SLACK_MAX_LENGTH = 1000

const val NCP_LOCAL_SEARCH_DISPLAY_COUNT = 10
const val IMAGE_DOMAIN = "https://image.whatnow.kr"
const val ASSERT_IMAGE_DOMAIN = "https://image.whatnow.kr/assert"
const val USER_DEFAULT_PROFILE_IMAGE = "https://image.whatnow.kr/assert/users/default.svg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface NcpLocalSearchClient {
fun searchByKeyword(
@RequestHeader("X-Naver-Client-Id") accessKey: String,
@RequestHeader("X-Naver-Client-Secret") secretKey: String,
@RequestParam display: Int = 10,
@RequestParam query: String,
): NcpMapInfoResponse
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class NcpLocalSearchClientTest() {
.withBody(responseJson),
),
)
val response = client.searchByKeyword(accessKey, secretKey, query)
val response = client.searchByKeyword(accessKey, secretKey, 10, query)
assertEquals(response.items.size, 1)
}
}

0 comments on commit 8158ad5

Please sign in to comment.