-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
226 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,10 +82,9 @@ jobs: | |
- name: Push Docker image to Docker Hub | ||
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }} | ||
|
||
# EC2 서버에 Docker Compose로 배포 | ||
- name: Deploy to server | ||
uses: appleboy/[email protected] | ||
id: deploy | ||
# SSH 비밀 키 설정 | ||
- name: Install SSH Key | ||
uses: webfactory/[email protected] | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USER }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/hyunsolution/dangu/chatlog/chatlogRepository/ChatlogRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.hyunsolution.dangu.chatlog.chatlogRepository; | ||
|
||
import com.hyunsolution.dangu.chatlog.Chatlog; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface ChatlogRepository extends JpaRepository<Chatlog, Long> { | ||
|
||
@Modifying | ||
@Query( | ||
"UPDATE Chatlog c SET c.readCount=:readCount WHERE c.user.id=:userId AND c.workspace.id=:workspaceId") | ||
void updateCount( | ||
@Param("userId") Long userId, | ||
@Param("workspaceId") Long workspaceId, | ||
@Param("readCount") int readCount); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/hyunsolution/dangu/chatlog/service/ChatlogService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.hyunsolution.dangu.chatlog.service; | ||
|
||
import com.hyunsolution.dangu.chatlog.chatlogRepository.ChatlogRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class ChatlogService { | ||
private final ChatlogRepository chatlogRepository; | ||
|
||
// 채팅방별 사용자의 읽은 채팅 개수 업데이트 | ||
@Transactional | ||
public void updateReadCount(Long chatRoomId, Long userPk, int messageCnt) { | ||
chatlogRepository.updateCount(chatRoomId, userPk, messageCnt); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
src/main/java/com/hyunsolution/dangu/chatting/domain/ChatRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
package com.hyunsolution.dangu.chatting.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface ChatRepository extends JpaRepository<Chatting, Long> {} | ||
public interface ChatRepository extends JpaRepository<Chatting, Long> { | ||
|
||
@Query("SELECT COUNT(c) FROM Chatlog c WHERE c.workspace.id=:roomId") | ||
int countMessageByRoomId(@Param("roomId") Long roomId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...n/java/com/hyunsolution/dangu/common/config/webSocket/WebSocketSwaggerDocsController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.hyunsolution.dangu.common.config.webSocket; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class WebSocketSwaggerDocsController { | ||
@Operation( | ||
summary = "WebSocket 연결 정보", | ||
description = | ||
""" | ||
WebSocket URL, 구독 경로 및 발행 경로 안내 | ||
- WebSocket 접속 URL: wss://54.221.244.36:8080/chat | ||
- STOMP 구독 주소: /topic/chat/{chatRoomId} | ||
- 메시지 전송 주소: /app/chat/{chatRoomId} | ||
""") | ||
@GetMapping("/websocket/info") // 스웨거 웹소켓관련 정보 제공을 위한 api | ||
public void getWebSocketInfo() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/com/hyunsolution/dangu/participant/dto/response/EnterChatRoomResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.hyunsolution.dangu.participant.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class EnterChatRoomResponse { | ||
private String message; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/hyunsolution/dangu/participant/exception/ParticipantError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.hyunsolution.dangu.participant.exception; | ||
|
||
import com.hyunsolution.dangu.common.exception.BaseErrorCode; | ||
import com.hyunsolution.dangu.common.exception.ExceptionDto; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum ParticipantError implements BaseErrorCode { | ||
PARTICIPANT_NOT_FOUND("PARTICIPANT_400_1", HttpStatus.BAD_REQUEST, "해당 채팅방 참여자를 찾을 수 없습니다."); | ||
|
||
private final String code; | ||
private final HttpStatus httpStatus; | ||
private final String message; | ||
|
||
@Override | ||
public ExceptionDto getErrorReason() { | ||
return ExceptionDto.builder().code(code).message(message).httpStatus(httpStatus).build(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/hyunsolution/dangu/participant/exception/ParticipantNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.hyunsolution.dangu.participant.exception; | ||
|
||
import com.hyunsolution.dangu.common.exception.CustomException; | ||
|
||
public class ParticipantNotFoundException extends CustomException { | ||
public static final ParticipantNotFoundException EXCEPTION = new ParticipantNotFoundException(); | ||
|
||
private ParticipantNotFoundException() { | ||
super(ParticipantError.PARTICIPANT_NOT_FOUND); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/java/com/hyunsolution/dangu/user/domain/UserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
package com.hyunsolution.dangu.user.domain; | ||
|
||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface UserRepository extends JpaRepository<User, Long> { | ||
Optional<User> findByUid(String uid); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/com/hyunsolution/dangu/workspace/exception/WorkspaceError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.hyunsolution.dangu.workspace.exception; | ||
|
||
import com.hyunsolution.dangu.common.exception.BaseErrorCode; | ||
import com.hyunsolution.dangu.common.exception.ExceptionDto; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum WorkspaceError implements BaseErrorCode { | ||
WORKSPACE_NOT_FOUND("WORKSAPCE_400_1", HttpStatus.BAD_REQUEST, "채팅방을 찾을 수 없습니다."); | ||
|
||
private final String code; | ||
private final HttpStatus httpStatus; | ||
private final String message; | ||
|
||
@Override | ||
public ExceptionDto getErrorReason() { | ||
return ExceptionDto.builder().code(code).message(message).httpStatus(httpStatus).build(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/hyunsolution/dangu/workspace/exception/WorkspaceNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.hyunsolution.dangu.workspace.exception; | ||
|
||
import com.hyunsolution.dangu.common.exception.CustomException; | ||
|
||
public class WorkspaceNotFoundException extends CustomException { | ||
public static final WorkspaceNotFoundException EXCEPTION = new WorkspaceNotFoundException(); | ||
|
||
private WorkspaceNotFoundException() { | ||
super(WorkspaceError.WORKSPACE_NOT_FOUND); | ||
} | ||
} |
Oops, something went wrong.