Skip to content

Commit

Permalink
Merge pull request #21 from oven-2023/recommendation
Browse files Browse the repository at this point in the history
logging
  • Loading branch information
see101702 authored Oct 20, 2023
2 parents efccba5 + 8fb7369 commit c150d68
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.oven.server.common.exception.BaseException;
import com.oven.server.common.response.ResponseCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
Expand All @@ -20,6 +21,7 @@
import java.util.List;
import java.util.Random;

@Slf4j
@Service
@RequiredArgsConstructor
public class SpringToFlaskService {
Expand All @@ -28,6 +30,8 @@ public class SpringToFlaskService {
private final WorkRepository workRepository;

public String springToFlask(User user) {
log.info(String.valueOf(user));

String flaskApiUrl = "http://0.0.0.0:6000/spring";
String userId = String.valueOf(user.getId());

Expand All @@ -47,10 +51,11 @@ public String springToFlask(User user) {

if (responseEntity.getStatusCode().is2xxSuccessful()) {
String response = responseEntity.getBody();
System.out.println("플라스크 서버 응답: " + response);
log.info("플라스크 서버 응답: " + response);
return response;
} else {
System.out.println("HTTP 요청 실패 " + responseEntity.getStatusCodeValue());
// System.out.println("HTTP 요청 실패 " + responseEntity.getStatusCodeValue());
log.info("HTTP 요청 실패 " + responseEntity.getStatusCodeValue());
return responseEntity.getStatusCode().toString();
}
}
Expand Down

0 comments on commit c150d68

Please sign in to comment.