diff --git a/src/main/java/com/devcard/devcard/chat/service/ChatService.java b/src/main/java/com/devcard/devcard/chat/service/ChatService.java index 1f012fe..6f2c58b 100644 --- a/src/main/java/com/devcard/devcard/chat/service/ChatService.java +++ b/src/main/java/com/devcard/devcard/chat/service/ChatService.java @@ -212,7 +212,7 @@ public Long extractUserIdFromSession(WebSocketSession session) { * @return 해당 파라미터 값 (존재하지 않으면 null 반환) */ private Long extractParamFromUri(String uri, String paramName) { - // e.g. `ws://localhost:8080/ws?chatId=1&userId=1` 입력의 경우, + // e.g. `ws://3.34.144.148:8080/ws?chatId=1&userId=1` 입력의 경우, try { // "?"로 나누어 쿼리 파라미터 부분만 가져옴 (e.g. `chatId=1&userId=1`) String[] parts = uri.split("\\?"); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 1968c83..7b1d23d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -18,7 +18,7 @@ spring.jpa.show-sql=true #spring.datasource.url=jdbc:h2:mem:test;MODE=MYSQL;DB_CLOSE_DELAY=-1 #spring.datasource.username=sa #spring.datasource.password= -spring.datasource.url=jdbc:mysql://localhost:3306/devcard_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&characterEncoding=UTF-8 +spring.datasource.url=jdbc:mysql://3.34.144.148:3306/devcard_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&characterEncoding=UTF-8 spring.datasource.username=${DB_USERNAME} spring.datasource.password=${DB_PASSWORD} spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver @@ -37,7 +37,7 @@ logging.level.org.springframework.security=DEBUG # QR Code Service -qr.domain.uri=http://localhost:8080/ +qr.domain.uri=http://3.34.144.148:8080/ qr.code.directory=src/main/resources/static/qrcodes/ # Kakao Service diff --git a/src/main/resources/static/js/card/card-share.js b/src/main/resources/static/js/card/card-share.js index e5ac237..6f0758c 100644 --- a/src/main/resources/static/js/card/card-share.js +++ b/src/main/resources/static/js/card/card-share.js @@ -8,16 +8,16 @@ document.getElementById('kakao-share-btn').addEventListener('click', function () description: '회사: [[${card.company}]], 직책: [[${card.position}]]', imageUrl: 'https://developers.kakao.com/assets/img/about/logos/kakaolink/kakaolink_btn_medium.png', link: { - mobileWebUrl: 'http://localhost:8080/cards/' + cardId + '/view', - webUrl: 'http://localhost:8080/cards/' + cardId + '/view' + mobileWebUrl: 'http://3.34.144.148:8080/cards/' + cardId + '/view', + webUrl: 'http://3.34.144.148:8080/cards/' + cardId + '/view' } }, buttons: [ { title: '명함 보기', link: { - mobileWebUrl: 'http://localhost:8080/cards/' + cardId + '/view', - webUrl: 'http://localhost:8080/cards/' + cardId + '/view' + mobileWebUrl: 'http://3.34.144.148:8080/cards/' + cardId + '/view', + webUrl: 'http://3.34.144.148:8080/cards/' + cardId + '/view' } } ], diff --git a/src/main/resources/static/js/chat.js b/src/main/resources/static/js/chat.js index 697f1ce..ccaa441 100644 --- a/src/main/resources/static/js/chat.js +++ b/src/main/resources/static/js/chat.js @@ -148,7 +148,7 @@ $(document).ready(function () { fetchChatRoom(chatId); // 임시로 로컬 서버 설정 - const socket = new WebSocket(`ws://localhost:8080/ws?chatId=${chatId}&userId=${memberId}`); + const socket = new WebSocket(`ws://3.34.144.148:8080/ws?chatId=${chatId}&userId=${memberId}`); // 웹소켓 연결 socket.addEventListener("open", () => { diff --git a/src/test/java/com/devcard/devcard/chat/service/ChatServiceTest.java b/src/test/java/com/devcard/devcard/chat/service/ChatServiceTest.java index b23d1c5..489a95d 100644 --- a/src/test/java/com/devcard/devcard/chat/service/ChatServiceTest.java +++ b/src/test/java/com/devcard/devcard/chat/service/ChatServiceTest.java @@ -370,7 +370,7 @@ void testExtractMessage_EmptyJsonObject() { @DisplayName("유효한 chatId 추출 성공") void testExtractChatIdFromSession_ValidChatId() { // 유효한 URI 설정 - when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws?chatId=1&userId=1")); + when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws?chatId=1&userId=1")); // chatId가 1로 반환되는지 확인 Long chatId = chatService.extractChatIdFromSession(session); @@ -381,7 +381,7 @@ void testExtractChatIdFromSession_ValidChatId() { @DisplayName("쿼리 파라미터 없음 - chatId") void testExtractChatIdFromSession_NoChatId() { // chatId가 없는 URI 설정 - when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws")); + when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws")); // chatId가 없으므로 IllegalArgumentException 발생 Exception exception = assertThrows( @@ -395,7 +395,7 @@ void testExtractChatIdFromSession_NoChatId() { @DisplayName("chatId 숫자 형식 오류") void testExtractChatIdFromSession_InvalidChatIdFormat() { // chatId가 잘못된 형식인 URI 설정 - when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws?chatId=abc&userId=1")); + when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws?chatId=abc&userId=1")); // chatId가 숫자 형식이 아니므로 IllegalArgumentException 발생 Exception exception = assertThrows( @@ -409,7 +409,7 @@ void testExtractChatIdFromSession_InvalidChatIdFormat() { @DisplayName("유효한 userId 추출 성공") void testExtractUserIdFromSession_ValidUserId() { // 유효한 URI 설정 - when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws?chatId=1&userId=1")); + when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws?chatId=1&userId=1")); // userId가 1로 반환되는지 확인 Long userId = chatService.extractUserIdFromSession(session); @@ -420,7 +420,7 @@ void testExtractUserIdFromSession_ValidUserId() { @DisplayName("쿼리 파라미터 없음 - userId") void testExtractUserIdFromSession_NoUserId() { // userId가 없는 URI 설정 - when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws")); + when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws")); // userId가 없으므로 IllegalArgumentException 발생 Exception exception = assertThrows( @@ -434,7 +434,7 @@ void testExtractUserIdFromSession_NoUserId() { @DisplayName("userId 숫자 형식 오류") void testExtractUserIdFromSession_InvalidUserIdFormat() { // userId가 잘못된 형식인 URI 설정 - when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws?chatId=1&userId=abc")); + when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws?chatId=1&userId=abc")); // userId가 숫자 형식이 아니므로 IllegalArgumentException 발생 Exception exception = assertThrows(