Skip to content

Commit

Permalink
환경설정
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseohyun1228 committed Dec 16, 2024
1 parent ef8e2a0 commit 53857a4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.pinu.familing.domain.chat.entity.Message;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
Expand All @@ -19,6 +20,9 @@
@EnableKafka
public class ListenerConfiguration {

@Value("${kafka.server}")
private String kafkaServer;

// KafkaListener 컨테이너 팩토리를 생성하는 Bean 메서드
@Bean
ConcurrentKafkaListenerContainerFactory<String, Message> kafkaListenerContainerFactory() {
Expand All @@ -38,7 +42,7 @@ public ConsumerFactory<String, Message> consumerFactory() {
Map<String, Object> consumerConfigurations =
ImmutableMap.<String, Object>builder()
//Kafka 클러스터의 주소를 설정합니다.
.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "43.203.180.185:9092")
.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaServer)
//이 그룹 ID는 Consumer가 동일한 그룹 내에서 협력하여 메시지를 처리하도록 합니다.
.put(ConsumerConfig.GROUP_ID_CONFIG, "familing")
//afka에서 수신한 메시지의 키를 역직렬화하는 데 사용됩니다.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@Component
public class CustomSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {

// @Value("${server.address}")
@Value("${server.ip}")
private String serverIp;

private final JWTUtil jwtUtil;
Expand Down Expand Up @@ -52,7 +52,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
response.sendRedirect("myapp://callback/register-screen1");
} else {
//Role이 없으면 다시 로그인 창으로
response.sendRedirect("http://43.203.180.185:8080/oauth2/authorization/kakao");
response.sendRedirect("http://"+serverIp+":8080/oauth2/authorization/kakao");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
Expand All @@ -17,9 +18,13 @@ public class KakaoController {

private final KakaoService kakaoService;

@Value("${server.ip}")
private String serverIp;

//0. 카카오 로그인 화면/api/v1/login/oauth/kakao 보여주기
@GetMapping("/api/v1/login/oauth/kakao")
public void requestKakaoLoginScreen(HttpServletResponse response) throws IOException {

response.sendRedirect(kakaoService.getKakaoLoginUrl());
}

Expand Down Expand Up @@ -48,7 +53,7 @@ private Cookie createCookie(String key, String value) {
// js가 쿠키를 가져가지 못하게
cookie.setHttpOnly(true);

cookie.setDomain("43.203.180.185");
cookie.setDomain(serverIp);

return cookie;
}
Expand Down
24 changes: 12 additions & 12 deletions familing/src/main/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,26 @@ VALUES ('나의 휴식 공간');


INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard1.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard1.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard2.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard2.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard3.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard3.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard4.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard4.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard5.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard5.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard6.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard6.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard7.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard7.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard8.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard8.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard9.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard9.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard10.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard10.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard11.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard11.png');
INSERT INTO lovecard (image)
VALUES ('https://familing-bucket.s3.ap-northeast-2.amazonaws.com/lovecard12.png');
VALUES ('https://sursim-img.s3.ap-northeast-2.amazonaws.com/lovecard12.png');

0 comments on commit 53857a4

Please sign in to comment.