Skip to content

Commit 8a6049f

Browse files
authored
🐛 fix: 데이트 코스 입력값 수정 (#107)
2 parents 1523e33 + d4fabf7 commit 8a6049f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/main/java/org/withtime/be/withtimebe/domain/date/repository/DatePlaceRepository.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ public interface DatePlaceRepository extends JpaRepository<DatePlace, Long> {
1212

1313
@Query("select d from DatePlace d" +
1414
" where d.lotNumberAddress like %:keyword1%" +
15-
" and d.lotNumberAddress like %:keyword2%")
15+
" and d.lotNumberAddress like %:keyword2%" +
16+
" and d.lotNumberAddress like %:keyword3%")
1617
List<DatePlace> findByAddressContainingAll(
1718
@Param("keyword1") String keyword1,
18-
@Param("keyword2") String keyword2
19+
@Param("keyword2") String keyword2,
20+
@Param("keyword3") String keyword3
1921
);
2022
}

src/main/java/org/withtime/be/withtimebe/domain/date/service/command/DateCommandServiceImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ private List<DatePlace> collectCandidatesByAddressTokens(List<String> tokens) {
131131
String[] parts = token.trim().split("\\s+");
132132
String k1 = parts.length >= 1 ? parts[0] : "";
133133
String k2 = parts.length >= 2 ? parts[1] : "";
134-
List<DatePlace> found = datePlaceRepository.findByAddressContainingAll(k1, k2);
134+
String k3 = (parts.length >= 3)
135+
? (parts[2].length() >= 2 ? parts[2].substring(0, 2) : parts[2])
136+
: "";
137+
List<DatePlace> found = datePlaceRepository.findByAddressContainingAll(k1, k2, k3);
135138
for (DatePlace p : found) {
136139
Long id = p.getId();
137140
if (id != null) {

0 commit comments

Comments
 (0)