Skip to content

Commit

Permalink
Fix: fastapi port 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sejoon00 committed May 27, 2024
1 parent ad6350d commit 1588aa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

Expand All @@ -22,7 +21,6 @@ public class ReviewNoteMakerService {
private final String serverUrl = UrlConstants.FASTAPI_SERVER_URL + "/review-note";


@Async
public CompletableFuture<Boolean> sendProblemInfoToPreprocessingServer(List<ReviewNoteProblemInfo> request, String filename, Member member) {
RestTemplate restTemplate = new RestTemplate();

Expand All @@ -31,8 +29,9 @@ public CompletableFuture<Boolean> sendProblemInfoToPreprocessingServer(List<Revi
.memberId(member.getId())
.filename(filename)
.build());

log.info("fastapi로 pdf 생성 요청을 보냅니다");
ResponseEntity<Void> responseEntity = restTemplate.postForEntity(serverUrl, requestHttpEntity, Void.class);
log.info("fastapi로 pdf 생성 요청을 보냈습니다. 결과 : {}", responseEntity.getStatusCode());

if (responseEntity.getStatusCode() != HttpStatus.OK) {
log.error("요청이 실패하였습니다. 응답 코드: {}", responseEntity.getStatusCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

Expand All @@ -23,7 +22,6 @@ public class PreprocessingService {
*
* @param filename 서버와 통신할 파일의 이름입니다.
*/
@Async
public CompletableFuture<Boolean> sendFilenameToPreprocessingServer(String filename) {
RestTemplate restTemplate = new RestTemplate();

Expand Down

0 comments on commit 1588aa6

Please sign in to comment.