You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LandController, LandApi: GET /lands에 선택 파라미터 query를 추가했습니다. 응답 형식은 기존 목록과 같습니다. Swagger에 검색 규칙을 적었습니다.
LandService: 검색어를 internal_name과 같은 규칙으로 바꾼 뒤 건물명 부분 일치로 찾습니다. 검색어가 없거나 공백뿐이면 지금처럼 전체 목록을 돌려줍니다.
Land.toInternalName: 이름에서 모든 공백(일반 공백, 탭, 줄바꿈, 전각 공백, 줄바꿈 방지 공백 등)을 빼고 소문자로 바꾸는 규칙을 한 곳에 모았습니다. 어드민 등록(AdminLandRequest)·수정(AdminLandService)과 학생 검색이 모두 이 함수를 씁니다. 지금까지 어드민은 일반 공백만 빼서, 탭이 든 이름은 저장값과 검색어가 어긋날 수 있었습니다.
LandRepository: findAllByIsDeletedFalseAndInternalNameContaining을 추가했습니다. 이미 있는 internal_name(건물명에서 띄어쓰기를 빼고 소문자로 바꾼 값, 인덱스 있음)으로 비교하고, 삭제된 건물은 제외합니다.
💬 참고 사항
기본값으로 정한 부분 (의견 부탁드립니다): 검색 대상은 건물명만입니다. 주소 검색이나 초성 검색이 필요하면 말씀 주세요.
기존 데이터의 internal_name이 모두 건물명과 같은 규칙(띄어쓰기 제거, 소문자)으로 들어가 있는 것을 확인해서 DB 변경은 없습니다.
기존 데이터에는 탭·전각 공백 같은 특수 공백이 없는 것을 확인해서, 저장된 값을 고치는 작업은 필요 없습니다.
검색어의 %, _는 일반 글자로 비교합니다(Spring Data Containing이 LIKE 특수 문자를 이스케이프함). 테스트로 확인했습니다.
머지 순서: feat: 복덕방 조회에서 삭제된 건물 제외 #2529(삭제된 건물 제외)가 LandRepository.findAll을 findAllByIsDeletedFalse로 바꿨습니다. #2529가 먼저 머지되면 이 PR에 develop을 합치고, 검색어가 없을 때도 삭제된 건물을 뺀 목록을 쓰도록 맞추겠습니다. 또 #2527이 AdminLandService의 같은 줄(내부 이름 계산)을 바꿔서, 늦게 머지되는 쪽에서 한 줄 충돌이 납니다. Land.toInternalName(request.name())으로 맞추면 됩니다.
테스트: LandApiTest에 띄어쓰기·부분 일치(별밭 하우스, 밭하우 등), 탭·줄바꿈·전각 공백·줄바꿈 방지 공백, 대소문자, 삭제된 건물 제외, 일치 없음·%·_이면 빈 목록, 검색어가 비었거나 특수 공백뿐일 때 전체 목록을 추가했습니다. AdminLandApiTest에 등록·수정 시 이름의 특수 공백을 빼고 내부 이름을 저장하는지 추가했습니다. ./gradlew clean test 1721개 통과(실패 0, 건너뜀 3).
GET /lands now accepts an optional building-name query. The service normalizes the query, returns all lands when it is blank, and otherwise searches non-deleted lands by partial internal-name match. Acceptance tests cover matching and empty-result cases.
Changes: Land search
Layer / File(s)
Summary
Endpoint and search flow src/main/java/in/koreatech/koin/domain/land/controller/LandApi.java, src/main/java/in/koreatech/koin/domain/land/controller/LandController.java, src/main/java/in/koreatech/koin/domain/land/service/LandService.java, src/main/java/in/koreatech/koin/domain/land/repository/LandRepository.java
GET /lands accepts an optional query parameter and passes it to the service. The service removes whitespace and lowercases the query. It loads all lands for an empty normalized query or searches non-deleted lands by partial internal-name match.
Acceptance tests cover spacing and case differences, partial matches, deleted lands, unmatched queries, and empty or whitespace-only queries. Fixtures add two named lands.
BCSDLab/KOIN_API_V2#2529: Both changes add repository queries for student land listings that exclude deleted lands.
Merge Risk: Low · previous review 45728
Uncommon whitespace can cause searches to miss buildings. The change is mergeable with these edge cases tracked.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly identifies the main change: adding building-name search to the student housing list.
Linked Issues check
Issue #2531 requires an optional query on GET /lands, normalized building-name partial matching, case and whitespace insensitivity, deleted-building exclusion, the existing response shape, the ful…
Out of Scope Changes check
The changed production files implement issue #2531 at the API, service, and repository layers. The added acceptance tests and fixtures support the required search cases. No unrelated change is shown i…
Full details: Linked Issues check
Explanation
Issue #2531 requires an optional query on GET /lands, normalized building-name partial matching, case and whitespace insensitivity, deleted-building exclusion, the existing response shape, the full list for empty queries, and an empty list for no matches. LandApi and LandController expose the parameter. LandService normalizes the query and selects the existing full-list path for an empty result or the non-deleted internal_name repository query otherwise. LandApiTest covers spacing, partial matching, case differences, deleted buildings, empty queries, and no matches including % and _.
Full details: Out of Scope Changes check
Explanation
The changed production files implement issue #2531 at the API, service, and repository layers. The added acceptance tests and fixtures support the required search cases. No unrelated change is shown in the reviewed pull-request summary or inspected files.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 6 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 개요
복덕방 학생 목록에서 건물명으로 검색할 수 있도록
GET /lands에 검색어 파라미터를 추가합니다. 앱·웹이 각자 목록을 거르면 플랫폼마다 결과가 달라질 수 있어서, 기존 기능들처럼 백엔드가 공통 검색을 제공합니다.🚀 주요 변경 내용
LandController,LandApi:GET /lands에 선택 파라미터query를 추가했습니다. 응답 형식은 기존 목록과 같습니다. Swagger에 검색 규칙을 적었습니다.LandService: 검색어를internal_name과 같은 규칙으로 바꾼 뒤 건물명 부분 일치로 찾습니다. 검색어가 없거나 공백뿐이면 지금처럼 전체 목록을 돌려줍니다.Land.toInternalName: 이름에서 모든 공백(일반 공백, 탭, 줄바꿈, 전각 공백, 줄바꿈 방지 공백 등)을 빼고 소문자로 바꾸는 규칙을 한 곳에 모았습니다. 어드민 등록(AdminLandRequest)·수정(AdminLandService)과 학생 검색이 모두 이 함수를 씁니다. 지금까지 어드민은 일반 공백만 빼서, 탭이 든 이름은 저장값과 검색어가 어긋날 수 있었습니다.LandRepository:findAllByIsDeletedFalseAndInternalNameContaining을 추가했습니다. 이미 있는internal_name(건물명에서 띄어쓰기를 빼고 소문자로 바꾼 값, 인덱스 있음)으로 비교하고, 삭제된 건물은 제외합니다.💬 참고 사항
internal_name이 모두 건물명과 같은 규칙(띄어쓰기 제거, 소문자)으로 들어가 있는 것을 확인해서 DB 변경은 없습니다.%,_는 일반 글자로 비교합니다(Spring DataContaining이 LIKE 특수 문자를 이스케이프함). 테스트로 확인했습니다.LandRepository.findAll을findAllByIsDeletedFalse로 바꿨습니다. #2529가 먼저 머지되면 이 PR에 develop을 합치고, 검색어가 없을 때도 삭제된 건물을 뺀 목록을 쓰도록 맞추겠습니다. 또 #2527이AdminLandService의 같은 줄(내부 이름 계산)을 바꿔서, 늦게 머지되는 쪽에서 한 줄 충돌이 납니다.Land.toInternalName(request.name())으로 맞추면 됩니다.LandApiTest에 띄어쓰기·부분 일치(별밭 하우스,밭하우등), 탭·줄바꿈·전각 공백·줄바꿈 방지 공백, 대소문자, 삭제된 건물 제외, 일치 없음·%·_이면 빈 목록, 검색어가 비었거나 특수 공백뿐일 때 전체 목록을 추가했습니다.AdminLandApiTest에 등록·수정 시 이름의 특수 공백을 빼고 내부 이름을 저장하는지 추가했습니다../gradlew clean test1721개 통과(실패 0, 건너뜀 3).✅ Checklist