From 434d58b19473309d154dbd651bb0b805875446f5 Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 05:37:04 +0900 Subject: [PATCH 01/10] =?UTF-8?q?FEAT:=20geoHash=20=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B8=8C=EB=9F=AC=EB=A6=AC=20=EC=B6=94=EA=B0=80=20(=EC=A7=81?= =?UTF-8?q?=EC=A0=91=20=EB=A7=8C=EB=93=A4=EA=B8=B0=20=EC=9C=84=ED=95=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.gradle b/build.gradle index 3d43dce..bd22506 100644 --- a/build.gradle +++ b/build.gradle @@ -125,6 +125,10 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-cache' implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8' + // GEO-HASH 의존성 추가 + implementation 'ch.hsr:geohash:1.4.0' + + //kafka implementation "org.springframework.kafka:spring-kafka" From 70da7425d9cbc510c1c08dde62165a204030a718 Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 05:37:59 +0900 Subject: [PATCH 02/10] =?UTF-8?q?FIX:=20Cache=20Config=20MaximumSize=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/spot/spot/global/config/CacheConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/spot/spot/global/config/CacheConfig.java b/src/main/java/spot/spot/global/config/CacheConfig.java index f5cd5d1..d49b0aa 100644 --- a/src/main/java/spot/spot/global/config/CacheConfig.java +++ b/src/main/java/spot/spot/global/config/CacheConfig.java @@ -15,7 +15,7 @@ public class CacheConfig { public CacheManager cacheManager() { CaffeineCacheManager manager = new CaffeineCacheManager("job-geohash"); manager.setCaffeine(Caffeine.newBuilder() - .maximumSize(10_000) + .maximumSize(200_000) .expireAfterWrite(Duration.ofDays(1)) .recordStats()); return manager; From 50b75050c031449ee126c997361a4c8be6da4744 Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 05:38:25 +0900 Subject: [PATCH 03/10] =?UTF-8?q?FIX:=20ErrorCode=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/spot/spot/global/response/format/ErrorCode.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/spot/spot/global/response/format/ErrorCode.java b/src/main/java/spot/spot/global/response/format/ErrorCode.java index 5bd7717..e0ad25c 100644 --- a/src/main/java/spot/spot/global/response/format/ErrorCode.java +++ b/src/main/java/spot/spot/global/response/format/ErrorCode.java @@ -49,6 +49,7 @@ public enum ErrorCode { // ALRAM INVALID_FCM_TOKEN(HttpStatus.NOT_ACCEPTABLE, "❌ 이 회원은 FCM 토큰이 전무하네요! 오래 접속하지 않았거나, 탈퇴회원 입니다. ❌ "), INVALID_TITLE(HttpStatus.NOT_ACCEPTABLE, "❌ 조회하신 일이 존재하지않습니다.! 결제준비된 상품인지 확인해주세요 ❌ "), + // POINT ALREADY_PAY_FAIL(HttpStatus.BAD_REQUEST, "이미 결제 취소된 내역입니다."), EMPTY_MEMBER(HttpStatus.BAD_REQUEST, "멤버 값이 비어있습니다."), EMPTY_TITLE(HttpStatus.BAD_REQUEST, "일 타이틀 값이 비어있습니다."), From 6e5eb970d25dae4714b3f503463fc5d069dc34e4 Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 05:38:51 +0900 Subject: [PATCH 04/10] =?UTF-8?q?FEAT:=20=EC=9C=84=EB=8F=84=20=EA=B2=BD?= =?UTF-8?q?=EB=8F=84=EB=A5=BC=20GEO-HASH=20=EB=AC=B8=EC=9E=90=EC=97=B4?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=ED=99=98=ED=95=98=EB=8A=94=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/job/query/util/caching/GeoHashUtil.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/main/java/spot/spot/domain/job/query/util/caching/GeoHashUtil.java diff --git a/src/main/java/spot/spot/domain/job/query/util/caching/GeoHashUtil.java b/src/main/java/spot/spot/domain/job/query/util/caching/GeoHashUtil.java new file mode 100644 index 0000000..de82ba3 --- /dev/null +++ b/src/main/java/spot/spot/domain/job/query/util/caching/GeoHashUtil.java @@ -0,0 +1,13 @@ +package spot.spot.domain.job.query.util.caching; + +import ch.hsr.geohash.GeoHash; +import org.springframework.stereotype.Component; + +@Component +public class GeoHashUtil { + // 위도 경도를 Geo-hash 문자열로 인코딩 -> Redis caching 시 Key로 쓰인다. + // precision: 정밀도, Geo-hash는 격자 기반, 여기서 precision 값이 커지면 검색 범위 격자가 좁아지고, 작아지면 검색 범위 격자가 넓어진다. + public String encode (double lat, double lng, int precision) { + return GeoHash.geoHashStringWithCharacterPrecision(lat, lng, precision); + } +} From f0cc0781f1722b0075a13de6f2af93f3b9a6e14e Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 05:40:30 +0900 Subject: [PATCH 05/10] =?UTF-8?q?FEAT:=20=EB=8F=99=EA=B8=B0=ED=99=94=20?= =?UTF-8?q?=EC=9A=A9=20Util=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../query/dto/response/NearByJobResponse.java | 22 ++++++ .../repository/dsl/SearchingListQueryDsl.java | 24 +++++++ .../util/caching/JobGeoCacheSyncService.java | 70 +++++++++++++++++++ .../spot/spot/global/util/ConstantUtil.java | 4 +- 4 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncService.java diff --git a/src/main/java/spot/spot/domain/job/query/dto/response/NearByJobResponse.java b/src/main/java/spot/spot/domain/job/query/dto/response/NearByJobResponse.java index 3765874..62dd4dc 100644 --- a/src/main/java/spot/spot/domain/job/query/dto/response/NearByJobResponse.java +++ b/src/main/java/spot/spot/domain/job/query/dto/response/NearByJobResponse.java @@ -1,6 +1,7 @@ package spot.spot.domain.job.query.dto.response; import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Objects; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -27,4 +28,25 @@ public class NearByJobResponse { private double dist; @Schema(description = "카카오페이 결제 번호") private String tid; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + NearByJobResponse that = (NearByJobResponse) o; + return id == that.id && + Double.compare(that.lat, lat) == 0 && + Double.compare(that.lng, lng) == 0 && + money == that.money && + Double.compare(that.dist, dist) == 0 && + Objects.equals(title, that.title) && + Objects.equals(content, that.content) && + Objects.equals(picture, that.picture); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, content, picture, lat, lng, money, dist); + } + } diff --git a/src/main/java/spot/spot/domain/job/query/repository/dsl/SearchingListQueryDsl.java b/src/main/java/spot/spot/domain/job/query/repository/dsl/SearchingListQueryDsl.java index 9a87f07..2db5580 100644 --- a/src/main/java/spot/spot/domain/job/query/repository/dsl/SearchingListQueryDsl.java +++ b/src/main/java/spot/spot/domain/job/query/repository/dsl/SearchingListQueryDsl.java @@ -188,4 +188,28 @@ public List findWorkersCertificationImgList(long jobId .where(matching.job.id.eq(jobId).and(matching.status.notIn(MatchingStatus.OWNER, MatchingStatus.ATTENDER, MatchingStatus.REQUEST))) .fetch(); } + + + @Transactional(readOnly = true) + public List findJobsforGeoHashSync() { + // MySQL 인식 용 + // QueryDSL 실행 (SPATIAL INDEX 사용) + return sqlQueryFactory + .select(Projections.constructor( + NearByJobResponse.class, + job.id, + job.title, + job.content, + job.img.as("picture"), + job.lat, + job.lng, + job.money, + Expressions.constant(0.0), + job.tid + )) + .from(job) + .where(job.startedAt.isNull(), job.location.isNotNull()) + .fetch(); + // 다음 페이지가 있는지 계산 + } } diff --git a/src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncService.java b/src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncService.java new file mode 100644 index 0000000..8661c04 --- /dev/null +++ b/src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncService.java @@ -0,0 +1,70 @@ +package spot.spot.domain.job.query.util.caching; + +import ch.hsr.geohash.GeoHash; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import spot.spot.domain.job.query.dto.response.NearByJobResponse; +import spot.spot.domain.job.query.repository.dsl.SearchingListQueryDsl; +import static spot.spot.global.util.ConstantUtil.GEOHASH_PRECISION; + +@Slf4j +@Service +@RequiredArgsConstructor +public class JobGeoCacheSyncService { + + private final SearchingListQueryDsl searchingListQueryDsl; + private final CacheManager cacheManager; + private final GeoHashUtil geoHashUtil; + + + @Transactional(readOnly = true) + public void syncGeoHashCache () { + int updateCnt = 0; + Cache cache = cacheManager.getCache("job-geohash"); + + List allResponses = searchingListQueryDsl.findJobsforGeoHashSync(); + Map> geoGrouped = new HashMap<>(); + + // KEY: GEOHASH 문자열 값, VALUE: response dto 값 + for(NearByJobResponse response : allResponses) { + String geoHash = geoHashUtil.encode(response.getLat(), response.getLng(), GEOHASH_PRECISION); + geoGrouped.computeIfAbsent(geoHash, key -> new ArrayList<>()).add(response); + } + + for(Map.Entry> entry : geoGrouped.entrySet()){ + String nowKey = entry.getKey(); + List dbList = entry.getValue(); + List cacheList = cache.get(nowKey, List.class); + + if(isChanged(cacheList, dbList)) { + cache.put(nowKey, dbList); + log.debug("[근처 일거리 찾기] {} 캐싱 갱신 {} 건", nowKey, dbList.size()); + updateCnt += dbList.size(); + } + log.info("[GeoHashCache] 캐시 동기화 완료 - 총 {}개 갱신 / 전체 {}", updateCnt, geoGrouped.size()); + } + } + + private boolean isChanged(List cacheList, List dbList) { + if(cacheList == null || cacheList.size() != dbList.size()) return true; + + Map dbListwithPK = dbList.stream() + .collect(Collectors.toMap(NearByJobResponse::getId, j -> j)); + + for(NearByJobResponse old : cacheList) { + NearByJobResponse updated = dbListwithPK.get(old.getId()); + if(updated == null || !updated.equals(old)) return true; + } + return false; + } +} diff --git a/src/main/java/spot/spot/global/util/ConstantUtil.java b/src/main/java/spot/spot/global/util/ConstantUtil.java index 8d760d6..1b5e7e9 100644 --- a/src/main/java/spot/spot/global/util/ConstantUtil.java +++ b/src/main/java/spot/spot/global/util/ConstantUtil.java @@ -7,11 +7,13 @@ public class ConstantUtil { public static final String TOKEN_PREFIX = "token:"; // 거리 계산 public static final double EARTH_RADIUS_KM = 6371; - // WORKER STAUTS + // WORKER STATUS public static final Integer STILL_WORKING = 0; public static final Integer LITTLE_BREAK = 1; // MESSAGE TYPE public static final String TYPE = "type"; public static final String PERMIT_ALL = "permitAll"; public static final String AUTH_ERROR = "auth_error"; + // GEO-HASH + public static final int GEOHASH_PRECISION = 7; } From fd8719ad2a17ea0923904cb880eb0314be40da80 Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 05:41:36 +0900 Subject: [PATCH 06/10] =?UTF-8?q?CHORE:=20=EB=8F=99=EA=B8=B0=ED=99=94=20Ut?= =?UTF-8?q?il=20=EC=9D=B4=EB=A6=84=20=EB=B0=94=EA=BE=B8=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{JobGeoCacheSyncService.java => JobGeoCacheSyncUtil.java} | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) rename src/main/java/spot/spot/domain/job/query/util/caching/{JobGeoCacheSyncService.java => JobGeoCacheSyncUtil.java} (96%) diff --git a/src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncService.java b/src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncUtil.java similarity index 96% rename from src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncService.java rename to src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncUtil.java index 8661c04..ed2d23a 100644 --- a/src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncService.java +++ b/src/main/java/spot/spot/domain/job/query/util/caching/JobGeoCacheSyncUtil.java @@ -1,11 +1,9 @@ package spot.spot.domain.job.query.util.caching; -import ch.hsr.geohash.GeoHash; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -20,7 +18,7 @@ @Slf4j @Service @RequiredArgsConstructor -public class JobGeoCacheSyncService { +public class JobGeoCacheSyncUtil { private final SearchingListQueryDsl searchingListQueryDsl; private final CacheManager cacheManager; From d069dfe10288088a5d5d482d412a7046616356ba Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 05:42:01 +0900 Subject: [PATCH 07/10] =?UTF-8?q?FEAT:=20=EC=84=9C=EB=B2=84=20=EB=B6=80?= =?UTF-8?q?=ED=8C=85=20=EC=8B=9C=20Redis=20=EB=8F=99=EA=B8=B0=ED=99=94=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../query/util/caching/GeoCacheWarmUp.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/java/spot/spot/domain/job/query/util/caching/GeoCacheWarmUp.java diff --git a/src/main/java/spot/spot/domain/job/query/util/caching/GeoCacheWarmUp.java b/src/main/java/spot/spot/domain/job/query/util/caching/GeoCacheWarmUp.java new file mode 100644 index 0000000..9a65ea3 --- /dev/null +++ b/src/main/java/spot/spot/domain/job/query/util/caching/GeoCacheWarmUp.java @@ -0,0 +1,20 @@ +package spot.spot.domain.job.query.util.caching; + +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +@Slf4j +@Component +@RequiredArgsConstructor +public class GeoCacheWarmUp { + + private final JobGeoCacheSyncUtil jobGeoCacheSyncUtil; + + @PostConstruct + public void warmUpGeoCacheOnStart() { + log.info("[GeoHashCache] 서버 부팅에 따른 동기화 시작"); + jobGeoCacheSyncUtil.syncGeoHashCache(); + } +} From 5aff43ea5e5edaad0234b83750dae71859637b83 Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 06:05:29 +0900 Subject: [PATCH 08/10] =?UTF-8?q?FEAT:=20=EB=B9=84=EB=8F=99=EA=B8=B0=20?= =?UTF-8?q?=EC=8A=A4=EC=BC=80=EC=A4=84=EB=9F=AC=EB=A5=BC=20=ED=99=9C?= =?UTF-8?q?=EC=9A=A9=ED=95=B4,=20=EC=84=9C=EB=B2=84=20=EB=A9=94=EB=AA=A8?= =?UTF-8?q?=EB=A6=AC=20=EC=BA=90=EC=8B=9C=20<->=20RDB=20=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=ED=99=94=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../util/caching/AsyncGeoCacheScheduler.java | 32 +++++++++++++++++++ .../spot/spot/global/util/ConstantUtil.java | 3 ++ 2 files changed, 35 insertions(+) create mode 100644 src/main/java/spot/spot/domain/job/query/util/caching/AsyncGeoCacheScheduler.java diff --git a/src/main/java/spot/spot/domain/job/query/util/caching/AsyncGeoCacheScheduler.java b/src/main/java/spot/spot/domain/job/query/util/caching/AsyncGeoCacheScheduler.java new file mode 100644 index 0000000..a53f50c --- /dev/null +++ b/src/main/java/spot/spot/domain/job/query/util/caching/AsyncGeoCacheScheduler.java @@ -0,0 +1,32 @@ +package spot.spot.domain.job.query.util.caching; + +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; +import org.springframework.stereotype.Component; +import org.springframework.transaction.support.TransactionTemplate; +import spot.spot.global.scheduler.SchedulingTask; +import static spot.spot.global.util.ConstantUtil.SYNC_INTERVAL; + +@Slf4j +@Component +@RequiredArgsConstructor +public class AsyncGeoCacheScheduler { + + private final ThreadPoolTaskScheduler taskScheduler; + private final JobGeoCacheSyncUtil jobGeoCacheSyncUtil; + private final TransactionTemplate transactionTemplate; + + @PostConstruct + public void start() { + SchedulingTask task = new SchedulingTask<>( + jobGeoCacheSyncUtil, + JobGeoCacheSyncUtil::syncGeoHashCache, + transactionTemplate + ); + + taskScheduler.scheduleWithFixedDelay(task, SYNC_INTERVAL); + log.info("[GeoHashCache] 비동기 스케줄링 시작 ({} 간격)", SYNC_INTERVAL); + } +} diff --git a/src/main/java/spot/spot/global/util/ConstantUtil.java b/src/main/java/spot/spot/global/util/ConstantUtil.java index 1b5e7e9..066526c 100644 --- a/src/main/java/spot/spot/global/util/ConstantUtil.java +++ b/src/main/java/spot/spot/global/util/ConstantUtil.java @@ -1,5 +1,7 @@ package spot.spot.global.util; +import java.time.Duration; + public class ConstantUtil { // FOR SECURITY public static final String AUTHORIZATION = "Authorization"; @@ -16,4 +18,5 @@ public class ConstantUtil { public static final String AUTH_ERROR = "auth_error"; // GEO-HASH public static final int GEOHASH_PRECISION = 7; + public static final Duration SYNC_INTERVAL = Duration.ofDays(1); } From 87b9756a6a00782746f33c8095831210abb539df Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 06:24:31 +0900 Subject: [PATCH 09/10] =?UTF-8?q?FEAT:=20GeoHash=209=EB=B0=A9=20=ED=83=90?= =?UTF-8?q?=EC=83=89=20=EA=B5=AC=ED=98=84=20=EB=B0=8F=20=EC=A0=95=EB=B0=80?= =?UTF-8?q?=EB=8F=84=20=EC=A4=84=EC=9D=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/query/util/caching/GeoHashUtil.java | 16 ++++++++++++++++ .../java/spot/spot/global/util/ConstantUtil.java | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/spot/spot/domain/job/query/util/caching/GeoHashUtil.java b/src/main/java/spot/spot/domain/job/query/util/caching/GeoHashUtil.java index de82ba3..fee210f 100644 --- a/src/main/java/spot/spot/domain/job/query/util/caching/GeoHashUtil.java +++ b/src/main/java/spot/spot/domain/job/query/util/caching/GeoHashUtil.java @@ -1,6 +1,10 @@ package spot.spot.domain.job.query.util.caching; import ch.hsr.geohash.GeoHash; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import org.springframework.stereotype.Component; @Component @@ -10,4 +14,16 @@ public class GeoHashUtil { public String encode (double lat, double lng, int precision) { return GeoHash.geoHashStringWithCharacterPrecision(lat, lng, precision); } + + public List geoNeighborHashes(double lat, double lng, int precision) { + GeoHash center = GeoHash.withCharacterPrecision(lat, lng, precision); + Set geoHashes = new HashSet<>(); + geoHashes.add(center.toBase32()); + + for(GeoHash neighbor : center.getAdjacent()) { + geoHashes.add(neighbor.toBase32()); + } + + return new ArrayList<>(geoHashes); + } } diff --git a/src/main/java/spot/spot/global/util/ConstantUtil.java b/src/main/java/spot/spot/global/util/ConstantUtil.java index 066526c..c12a2bc 100644 --- a/src/main/java/spot/spot/global/util/ConstantUtil.java +++ b/src/main/java/spot/spot/global/util/ConstantUtil.java @@ -17,6 +17,6 @@ public class ConstantUtil { public static final String PERMIT_ALL = "permitAll"; public static final String AUTH_ERROR = "auth_error"; // GEO-HASH - public static final int GEOHASH_PRECISION = 7; + public static final int GEOHASH_PRECISION = 6; public static final Duration SYNC_INTERVAL = Duration.ofDays(1); } From 306d5a470724d9ca542f12113a31b42d4e23e215 Mon Sep 17 00:00:00 2001 From: dalcheonroadhead Date: Wed, 2 Apr 2025 06:28:21 +0900 Subject: [PATCH 10/10] =?UTF-8?q?FEAT:=20JOB=20=EC=A0=84=EC=B2=B4=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20->=20JDBC=20=EC=BF=BC=EB=A6=AC=20=ED=8C=A9?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=20->=20JPA=20=EC=BF=BC=EB=A6=AC=20=ED=8C=A9?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=EB=A1=9C=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/job/query/repository/dsl/SearchingListQueryDsl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/spot/spot/domain/job/query/repository/dsl/SearchingListQueryDsl.java b/src/main/java/spot/spot/domain/job/query/repository/dsl/SearchingListQueryDsl.java index 2db5580..61b4cde 100644 --- a/src/main/java/spot/spot/domain/job/query/repository/dsl/SearchingListQueryDsl.java +++ b/src/main/java/spot/spot/domain/job/query/repository/dsl/SearchingListQueryDsl.java @@ -42,6 +42,7 @@ public class SearchingListQueryDsl implements SearchingListQueryDocs { // java private final QWorkerAbility workerAbility = QWorkerAbility.workerAbility; private final QMatching matching = QMatching.matching; private final QMember member = QMember.member; + private final JPAQueryFactory jpaQueryFactory; @Transactional(readOnly = true) public Slice findNearByJobsWithQueryDSL(double lat, double lng, double dist, Pageable pageable) { @@ -194,7 +195,7 @@ public List findWorkersCertificationImgList(long jobId public List findJobsforGeoHashSync() { // MySQL 인식 용 // QueryDSL 실행 (SPATIAL INDEX 사용) - return sqlQueryFactory + return jpaQueryFactory .select(Projections.constructor( NearByJobResponse.class, job.id,