diff --git a/.gradle/7.2/executionHistory/executionHistory.bin b/.gradle/7.2/executionHistory/executionHistory.bin index a71bf63..15804b8 100644 Binary files a/.gradle/7.2/executionHistory/executionHistory.bin and b/.gradle/7.2/executionHistory/executionHistory.bin differ diff --git a/.gradle/7.2/executionHistory/executionHistory.lock b/.gradle/7.2/executionHistory/executionHistory.lock index f32727a..c2ff334 100644 Binary files a/.gradle/7.2/executionHistory/executionHistory.lock and b/.gradle/7.2/executionHistory/executionHistory.lock differ diff --git a/.gradle/7.2/fileHashes/fileHashes.bin b/.gradle/7.2/fileHashes/fileHashes.bin index 40fe98b..db11a35 100644 Binary files a/.gradle/7.2/fileHashes/fileHashes.bin and b/.gradle/7.2/fileHashes/fileHashes.bin differ diff --git a/.gradle/7.2/fileHashes/fileHashes.lock b/.gradle/7.2/fileHashes/fileHashes.lock index 8d33a31..de06048 100644 Binary files a/.gradle/7.2/fileHashes/fileHashes.lock and b/.gradle/7.2/fileHashes/fileHashes.lock differ diff --git a/.gradle/7.2/fileHashes/resourceHashesCache.bin b/.gradle/7.2/fileHashes/resourceHashesCache.bin index a316b33..492e6a8 100644 Binary files a/.gradle/7.2/fileHashes/resourceHashesCache.bin and b/.gradle/7.2/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 4fc68dc..773790f 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/src/main/generated/com/example/just/Mapper/MemberMapperImpl.java b/src/main/generated/com/example/just/Mapper/MemberMapperImpl.java index 761fa7c..99859d2 100644 --- a/src/main/generated/com/example/just/Mapper/MemberMapperImpl.java +++ b/src/main/generated/com/example/just/Mapper/MemberMapperImpl.java @@ -10,7 +10,7 @@ @Generated( value = "org.mapstruct.ap.MappingProcessor", - date = "2024-05-31T13:27:07+0900", + date = "2024-06-03T09:49:05+0900", comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.11 (AdoptOpenJDK)" ) @Component diff --git a/src/main/generated/com/example/just/Mapper/PostMapperImpl.java b/src/main/generated/com/example/just/Mapper/PostMapperImpl.java index 06a3fdf..331c018 100644 --- a/src/main/generated/com/example/just/Mapper/PostMapperImpl.java +++ b/src/main/generated/com/example/just/Mapper/PostMapperImpl.java @@ -10,7 +10,7 @@ @Generated( value = "org.mapstruct.ap.MappingProcessor", - date = "2024-05-31T13:27:07+0900", + date = "2024-06-03T09:49:06+0900", comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.11 (AdoptOpenJDK)" ) @Component diff --git a/src/main/java/com/example/just/JustApplication.java b/src/main/java/com/example/just/JustApplication.java index e1e366c..7432606 100644 --- a/src/main/java/com/example/just/JustApplication.java +++ b/src/main/java/com/example/just/JustApplication.java @@ -10,7 +10,6 @@ import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.web.client.RestTemplate; @SpringBootApplication @EnableElasticsearchRepositories( diff --git a/src/main/java/com/example/just/Service/PostService.java b/src/main/java/com/example/just/Service/PostService.java index 1ac7a4b..5dedecb 100644 --- a/src/main/java/com/example/just/Service/PostService.java +++ b/src/main/java/com/example/just/Service/PostService.java @@ -362,7 +362,7 @@ public ResponseGetPost searchByCursorMember(String cursor, Long limit, Long memb randomIndex = random.nextInt(arrayLength); String randonHashTagName = likePostHashTagName.get(randomIndex); // 요청을 보낼 URL 설정 - HttpGet request = new HttpGet("http://34.22.67.43:8081/api/similar_words/" + randonHashTagName); + HttpGet request = new HttpGet("http://127.0.0.1:8081/api/similar_words/" + randonHashTagName); // 요청 실행 및 응답 수신 HttpResponse response = httpClient.execute(request); @@ -370,28 +370,28 @@ public ResponseGetPost searchByCursorMember(String cursor, Long limit, Long memb // 응답 코드 확인 int statusCode = response.getStatusLine().getStatusCode(); System.out.println("Response Code: " + statusCode); - if (statusCode == 200) { - - // 응답 데이터 읽기 - String responseBody = EntityUtils.toString(response.getEntity()); - - // 여기서 Python Server의 추천 시스템으로 Post_id들을 가져온다. - List postIds = new ArrayList<>(); - for (int i = 2; i < responseBody.length(); i += 5) { - postIds.add(Long.parseLong(responseBody.substring(i, i + 1))); - } - - results = query.select(post) - .from(post) - .where(post.post_id.notIn(viewedPostIds), // 이전에 본 글들의 ID를 제외합니다. - post.post_create_time.isNotNull(), // 글 작성 시간이 NULL이 아닌 글들만 가져옵니다. - post.post_id.notIn(blames), // 신고한 글들의 ID를 제외합니다. - post.member.id.notIn(targetMembers),// 신고당한 회원들의 ID를 제외합니다. - post.post_id.in(postIds)) // 추천 시스템으로 가져온 글들의 ID만 가져옵니다. - .orderBy(Expressions.numberTemplate(Double.class, "function('rand')").asc()) // 랜덤으로 정렬합니다. - .limit(limit) - .fetch(); - } else { +// if (statusCode == 200) { +// +// // 응답 데이터 읽기 +// String responseBody = EntityUtils.toString(response.getEntity()); +// +// // 여기서 Python Server의 추천 시스템으로 Post_id들을 가져온다. +// List postIds = new ArrayList<>(); +// for (int i = 2; i < responseBody.length(); i += 5) { +// postIds.add(Long.parseLong(responseBody.substring(i, i + 1))); +// } +// +// results = query.select(post) +// .from(post) +// .where(post.post_id.notIn(viewedPostIds), // 이전에 본 글들의 ID를 제외합니다. +// post.post_create_time.isNotNull(), // 글 작성 시간이 NULL이 아닌 글들만 가져옵니다. +// post.post_id.notIn(blames), // 신고한 글들의 ID를 제외합니다. +// post.member.id.notIn(targetMembers),// 신고당한 회원들의 ID를 제외합니다. +// post.post_id.in(postIds)) // 추천 시스템으로 가져온 글들의 ID만 가져옵니다. +// .orderBy(Expressions.numberTemplate(Double.class, "function('rand')").asc()) // 랜덤으로 정렬합니다. +// .limit(limit) +// .fetch(); +// } else { results = query.select(post) .from(post) .where(post.post_id.notIn(viewedPostIds), // 이전에 본 글들의 ID를 제외합니다. @@ -401,7 +401,7 @@ public ResponseGetPost searchByCursorMember(String cursor, Long limit, Long memb .orderBy(Expressions.numberTemplate(Double.class, "function('rand')").asc()) .limit(limit) .fetch(); - } + } else { results = query.select(post)