[NOOK-125] DB 전체 및 내 저장 장소 검색 API - #84
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31dd7806d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| val longitude: BigDecimal | ||
| val thumbnailUrl: String? | ||
| val representativeTags: String? | ||
| val bookmarked: Boolean |
There was a problem hiding this comment.
Convert native bookmark values before projecting as Boolean
For any non-empty result, both native queries expose EXISTS (...) or TRUE as a MySQL numeric value, but this projection requests Boolean; Connector/J returns these expressions as Long, causing a ClassCastException when toView() reads bookmarked and turning successful searches into HTTP 500 responses. This repository already documents the same failure mode in docs/tasks/NOOK-93/README.md; project the numeric value and explicitly convert it to Boolean instead.
Useful? React with 👍 / 👎.
| require(keyword.isNotEmpty()) { "Place search keyword must not be blank" } | ||
| require(query.page >= 0) { "Place search page is invalid" } | ||
| require(query.size in 1..MAX_PAGE_SIZE) { "Place search page size is invalid" } | ||
| val rows = port.searchAll(query.userId, keyword, Math.multiplyExact(query.page, query.size), query.size + 1) |
There was a problem hiding this comment.
Reject page values that overflow the offset
When a client supplies a nonnegative page whose page * size exceeds Int.MAX_VALUE—for example page=21474837&size=100, which passes the controller constraints—Math.multiplyExact throws ArithmeticException. GlobalExceptionHandler does not classify that as an invalid request, so both new search endpoints return HTTP 500 for validly parsed client input; bound the page/offset or calculate it in a wider type and reject out-of-range values as HTTP 400.
Useful? React with 👍 / 👎.
|
이거 어떤 작업이에요?? |
|
혹쉬 게시물에 장소 추가를 위한 검색? |
오케잉 |
|
요거 어떻게 정리 되었드라요 |
|
이거 우선 이렇게 검색하지는 않을거같아서 pr 취소하면 될거같아 |
목적
서비스 DB에 저장된 전체 장소와 로그인 사용자가 저장한 장소를 장소명·주소 부분 일치로 검색할 수 있도록 합니다.
변경 내용
API
검증