diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/EnterChatRoomResponse.java b/backend/src/main/java/com/happy/friendogly/chat/dto/response/EnterChatRoomResponse.java deleted file mode 100644 index 4c796b391..000000000 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/EnterChatRoomResponse.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.happy.friendogly.chat.dto.response; - -public record EnterChatRoomResponse(Long chatRoomId) { - -} diff --git a/backend/src/main/java/com/happy/friendogly/chat/controller/ChatMessageController.java b/backend/src/main/java/com/happy/friendogly/chatmessage/controller/ChatMessageController.java similarity index 60% rename from backend/src/main/java/com/happy/friendogly/chat/controller/ChatMessageController.java rename to backend/src/main/java/com/happy/friendogly/chatmessage/controller/ChatMessageController.java index 03f824bbd..ce9fc7895 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/controller/ChatMessageController.java +++ b/backend/src/main/java/com/happy/friendogly/chatmessage/controller/ChatMessageController.java @@ -1,9 +1,9 @@ -package com.happy.friendogly.chat.controller; +package com.happy.friendogly.chatmessage.controller; import com.happy.friendogly.auth.Auth; -import com.happy.friendogly.chat.dto.request.FindMessagesByTimeRangeRequest; -import com.happy.friendogly.chat.dto.response.FindChatMessagesResponse; -import com.happy.friendogly.chat.service.ChatQueryService; +import com.happy.friendogly.chatmessage.dto.request.FindMessagesByTimeRangeRequest; +import com.happy.friendogly.chatmessage.dto.response.FindChatMessagesResponse; +import com.happy.friendogly.chatmessage.service.ChatMessageQueryService; import com.happy.friendogly.common.ApiResponse; import jakarta.validation.Valid; import java.util.List; @@ -16,10 +16,10 @@ @RequestMapping("/chat-messages") public class ChatMessageController { - private final ChatQueryService chatQueryService; + private final ChatMessageQueryService chatMessageQueryService; - public ChatMessageController(ChatQueryService chatQueryService) { - this.chatQueryService = chatQueryService; + public ChatMessageController(ChatMessageQueryService chatMessageQueryService) { + this.chatMessageQueryService = chatMessageQueryService; } // TODO: 전체 조회 API 필요성 논의 필요, 만약 필요하다면 페이징을 통한 성능 개선 필요 @@ -28,7 +28,7 @@ public ApiResponse> findAllByChatRoomId( @Auth Long memberId, @PathVariable("chatRoomId") Long chatRoomId ) { - return ApiResponse.ofSuccess(chatQueryService.findAllByChatRoomId(memberId, chatRoomId)); + return ApiResponse.ofSuccess(chatMessageQueryService.findAllByChatRoomId(memberId, chatRoomId)); } @GetMapping("/{chatRoomId}/times") @@ -37,6 +37,6 @@ public ApiResponse> findAllByTimeRange( @Valid FindMessagesByTimeRangeRequest request, @PathVariable("chatRoomId") Long chatRoomId ) { - return ApiResponse.ofSuccess(chatQueryService.findByTimeRange(memberId, chatRoomId, request)); + return ApiResponse.ofSuccess(chatMessageQueryService.findByTimeRange(memberId, chatRoomId, request)); } } diff --git a/backend/src/main/java/com/happy/friendogly/chat/domain/ChatMessage.java b/backend/src/main/java/com/happy/friendogly/chatmessage/domain/ChatMessage.java similarity index 90% rename from backend/src/main/java/com/happy/friendogly/chat/domain/ChatMessage.java rename to backend/src/main/java/com/happy/friendogly/chatmessage/domain/ChatMessage.java index c29040211..24ca56974 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/domain/ChatMessage.java +++ b/backend/src/main/java/com/happy/friendogly/chatmessage/domain/ChatMessage.java @@ -1,5 +1,7 @@ -package com.happy.friendogly.chat.domain; +package com.happy.friendogly.chatmessage.domain; +import com.happy.friendogly.chatsocket.domain.MessageType; +import com.happy.friendogly.chatroom.domain.ChatRoom; import com.happy.friendogly.member.domain.Member; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/request/FindMessagesByTimeRangeRequest.java b/backend/src/main/java/com/happy/friendogly/chatmessage/dto/request/FindMessagesByTimeRangeRequest.java similarity index 88% rename from backend/src/main/java/com/happy/friendogly/chat/dto/request/FindMessagesByTimeRangeRequest.java rename to backend/src/main/java/com/happy/friendogly/chatmessage/dto/request/FindMessagesByTimeRangeRequest.java index 0349def9d..3096a9314 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/request/FindMessagesByTimeRangeRequest.java +++ b/backend/src/main/java/com/happy/friendogly/chatmessage/dto/request/FindMessagesByTimeRangeRequest.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.request; +package com.happy.friendogly.chatmessage.dto.request; import jakarta.validation.constraints.Past; import java.time.LocalDateTime; diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/FindChatMessagesResponse.java b/backend/src/main/java/com/happy/friendogly/chatmessage/dto/response/FindChatMessagesResponse.java similarity index 79% rename from backend/src/main/java/com/happy/friendogly/chat/dto/response/FindChatMessagesResponse.java rename to backend/src/main/java/com/happy/friendogly/chatmessage/dto/response/FindChatMessagesResponse.java index bae279efb..1093d30c4 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/FindChatMessagesResponse.java +++ b/backend/src/main/java/com/happy/friendogly/chatmessage/dto/response/FindChatMessagesResponse.java @@ -1,7 +1,7 @@ -package com.happy.friendogly.chat.dto.response; +package com.happy.friendogly.chatmessage.dto.response; -import com.happy.friendogly.chat.domain.ChatMessage; -import com.happy.friendogly.chat.domain.MessageType; +import com.happy.friendogly.chatmessage.domain.ChatMessage; +import com.happy.friendogly.chatsocket.domain.MessageType; import java.time.LocalDateTime; public record FindChatMessagesResponse( diff --git a/backend/src/main/java/com/happy/friendogly/chat/repository/ChatMessageRepository.java b/backend/src/main/java/com/happy/friendogly/chatmessage/repository/ChatMessageRepository.java similarity index 88% rename from backend/src/main/java/com/happy/friendogly/chat/repository/ChatMessageRepository.java rename to backend/src/main/java/com/happy/friendogly/chatmessage/repository/ChatMessageRepository.java index cb65137a0..fc5052559 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/repository/ChatMessageRepository.java +++ b/backend/src/main/java/com/happy/friendogly/chatmessage/repository/ChatMessageRepository.java @@ -1,6 +1,6 @@ -package com.happy.friendogly.chat.repository; +package com.happy.friendogly.chatmessage.repository; -import com.happy.friendogly.chat.domain.ChatMessage; +import com.happy.friendogly.chatmessage.domain.ChatMessage; import java.time.LocalDateTime; import java.util.List; import org.springframework.data.jpa.repository.EntityGraph; diff --git a/backend/src/main/java/com/happy/friendogly/chat/service/ChatQueryService.java b/backend/src/main/java/com/happy/friendogly/chatmessage/service/ChatMessageQueryService.java similarity index 82% rename from backend/src/main/java/com/happy/friendogly/chat/service/ChatQueryService.java rename to backend/src/main/java/com/happy/friendogly/chatmessage/service/ChatMessageQueryService.java index f41657d6f..0f7f79318 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/service/ChatQueryService.java +++ b/backend/src/main/java/com/happy/friendogly/chatmessage/service/ChatMessageQueryService.java @@ -1,13 +1,13 @@ -package com.happy.friendogly.chat.service; +package com.happy.friendogly.chatmessage.service; import static org.springframework.http.HttpStatus.FORBIDDEN; -import com.happy.friendogly.chat.domain.ChatMessage; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.dto.request.FindMessagesByTimeRangeRequest; -import com.happy.friendogly.chat.dto.response.FindChatMessagesResponse; -import com.happy.friendogly.chat.repository.ChatMessageRepository; -import com.happy.friendogly.chat.repository.ChatRoomRepository; +import com.happy.friendogly.chatmessage.domain.ChatMessage; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatmessage.dto.request.FindMessagesByTimeRangeRequest; +import com.happy.friendogly.chatmessage.dto.response.FindChatMessagesResponse; +import com.happy.friendogly.chatmessage.repository.ChatMessageRepository; +import com.happy.friendogly.chatroom.repository.ChatRoomRepository; import com.happy.friendogly.exception.FriendoglyException; import com.happy.friendogly.member.domain.Member; import com.happy.friendogly.member.repository.MemberRepository; @@ -18,13 +18,13 @@ @Service @Transactional(readOnly = true) -public class ChatQueryService { +public class ChatMessageQueryService { private final ChatMessageRepository chatMessageRepository; private final MemberRepository memberRepository; private final ChatRoomRepository chatRoomRepository; - public ChatQueryService( + public ChatMessageQueryService( ChatMessageRepository chatMessageRepository, MemberRepository memberRepository, ChatRoomRepository chatRoomRepository diff --git a/backend/src/main/java/com/happy/friendogly/chat/controller/ChatRoomController.java b/backend/src/main/java/com/happy/friendogly/chatroom/controller/ChatRoomController.java similarity index 79% rename from backend/src/main/java/com/happy/friendogly/chat/controller/ChatRoomController.java rename to backend/src/main/java/com/happy/friendogly/chatroom/controller/ChatRoomController.java index 7525468ac..ab673c0bb 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/controller/ChatRoomController.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/controller/ChatRoomController.java @@ -1,13 +1,13 @@ -package com.happy.friendogly.chat.controller; +package com.happy.friendogly.chatroom.controller; import com.happy.friendogly.auth.Auth; -import com.happy.friendogly.chat.dto.request.SaveChatRoomRequest; -import com.happy.friendogly.chat.dto.response.FindChatRoomMembersInfoResponse; -import com.happy.friendogly.chat.dto.response.FindClubDetailsResponse; -import com.happy.friendogly.chat.dto.response.FindMyChatRoomResponse; -import com.happy.friendogly.chat.dto.response.SaveChatRoomResponse; -import com.happy.friendogly.chat.service.ChatRoomCommandService; -import com.happy.friendogly.chat.service.ChatRoomQueryService; +import com.happy.friendogly.chatroom.dto.request.SaveChatRoomRequest; +import com.happy.friendogly.chatroom.dto.response.FindChatRoomMembersInfoResponse; +import com.happy.friendogly.chatroom.dto.response.FindClubDetailsResponse; +import com.happy.friendogly.chatroom.dto.response.FindMyChatRoomResponse; +import com.happy.friendogly.chatroom.dto.response.SaveChatRoomResponse; +import com.happy.friendogly.chatroom.service.ChatRoomCommandService; +import com.happy.friendogly.chatroom.service.ChatRoomQueryService; import com.happy.friendogly.common.ApiResponse; import java.util.List; import org.springframework.web.bind.annotation.GetMapping; diff --git a/backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoom.java b/backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoom.java similarity index 98% rename from backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoom.java rename to backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoom.java index 43e78c54b..7efb6ffb1 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoom.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoom.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.domain; +package com.happy.friendogly.chatroom.domain; import com.happy.friendogly.exception.FriendoglyException; import com.happy.friendogly.member.domain.Member; diff --git a/backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoomMember.java b/backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoomMember.java similarity index 96% rename from backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoomMember.java rename to backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoomMember.java index 67f8d7b9a..add2c958f 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoomMember.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoomMember.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.domain; +package com.happy.friendogly.chatroom.domain; import com.happy.friendogly.member.domain.Member; import jakarta.persistence.Entity; diff --git a/backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoomType.java b/backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoomType.java similarity index 54% rename from backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoomType.java rename to backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoomType.java index 94f380f06..2900ba258 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/domain/ChatRoomType.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/domain/ChatRoomType.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.domain; +package com.happy.friendogly.chatroom.domain; public enum ChatRoomType { diff --git a/backend/src/main/java/com/happy/friendogly/chat/domain/MemberCapacity.java b/backend/src/main/java/com/happy/friendogly/chatroom/domain/MemberCapacity.java similarity index 95% rename from backend/src/main/java/com/happy/friendogly/chat/domain/MemberCapacity.java rename to backend/src/main/java/com/happy/friendogly/chatroom/domain/MemberCapacity.java index 03bf3fab9..382b1d608 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/domain/MemberCapacity.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/domain/MemberCapacity.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.domain; +package com.happy.friendogly.chatroom.domain; import com.happy.friendogly.exception.FriendoglyException; import jakarta.persistence.Column; diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/request/InviteToChatRoomRequest.java b/backend/src/main/java/com/happy/friendogly/chatroom/dto/request/InviteToChatRoomRequest.java similarity index 66% rename from backend/src/main/java/com/happy/friendogly/chat/dto/request/InviteToChatRoomRequest.java rename to backend/src/main/java/com/happy/friendogly/chatroom/dto/request/InviteToChatRoomRequest.java index b058f3d02..7065297eb 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/request/InviteToChatRoomRequest.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/dto/request/InviteToChatRoomRequest.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.request; +package com.happy.friendogly.chatroom.dto.request; public record InviteToChatRoomRequest( Long receiverMemberId, diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/request/SaveChatRoomRequest.java b/backend/src/main/java/com/happy/friendogly/chatroom/dto/request/SaveChatRoomRequest.java similarity index 54% rename from backend/src/main/java/com/happy/friendogly/chat/dto/request/SaveChatRoomRequest.java rename to backend/src/main/java/com/happy/friendogly/chatroom/dto/request/SaveChatRoomRequest.java index 48a4b6178..9bd8261ed 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/request/SaveChatRoomRequest.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/dto/request/SaveChatRoomRequest.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.request; +package com.happy.friendogly.chatroom.dto.request; public record SaveChatRoomRequest(Long otherMemberId) { diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/ChatRoomDetail.java b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/ChatRoomDetail.java similarity index 78% rename from backend/src/main/java/com/happy/friendogly/chat/dto/response/ChatRoomDetail.java rename to backend/src/main/java/com/happy/friendogly/chatroom/dto/response/ChatRoomDetail.java index 26302b9ee..182e9c03b 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/ChatRoomDetail.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/ChatRoomDetail.java @@ -1,6 +1,6 @@ -package com.happy.friendogly.chat.dto.response; +package com.happy.friendogly.chatroom.dto.response; -import com.happy.friendogly.chat.domain.ChatRoom; +import com.happy.friendogly.chatroom.domain.ChatRoom; public record ChatRoomDetail( Long chatRoomId, diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/FindChatRoomMembersInfoResponse.java b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindChatRoomMembersInfoResponse.java similarity index 88% rename from backend/src/main/java/com/happy/friendogly/chat/dto/response/FindChatRoomMembersInfoResponse.java rename to backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindChatRoomMembersInfoResponse.java index dffde62d7..8d2561dd9 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/FindChatRoomMembersInfoResponse.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindChatRoomMembersInfoResponse.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.response; +package com.happy.friendogly.chatroom.dto.response; import com.happy.friendogly.member.domain.Member; diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/FindClubDetailsResponse.java b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindClubDetailsResponse.java similarity index 94% rename from backend/src/main/java/com/happy/friendogly/chat/dto/response/FindClubDetailsResponse.java rename to backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindClubDetailsResponse.java index ceccea6e2..1e3efae34 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/FindClubDetailsResponse.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindClubDetailsResponse.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.response; +package com.happy.friendogly.chatroom.dto.response; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.pet.domain.Gender; diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/FindMyChatRoomResponse.java b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindMyChatRoomResponse.java similarity index 72% rename from backend/src/main/java/com/happy/friendogly/chat/dto/response/FindMyChatRoomResponse.java rename to backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindMyChatRoomResponse.java index 796c7933c..fcf047ff1 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/FindMyChatRoomResponse.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/FindMyChatRoomResponse.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.response; +package com.happy.friendogly.chatroom.dto.response; import java.util.List; diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/InviteToChatRoomResponse.java b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/InviteToChatRoomResponse.java similarity index 54% rename from backend/src/main/java/com/happy/friendogly/chat/dto/response/InviteToChatRoomResponse.java rename to backend/src/main/java/com/happy/friendogly/chatroom/dto/response/InviteToChatRoomResponse.java index e2dcef752..f55bb60eb 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/InviteToChatRoomResponse.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/InviteToChatRoomResponse.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.response; +package com.happy.friendogly.chatroom.dto.response; public record InviteToChatRoomResponse(Long chatRoomId) { diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/SaveChatRoomResponse.java b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/SaveChatRoomResponse.java similarity index 52% rename from backend/src/main/java/com/happy/friendogly/chat/dto/response/SaveChatRoomResponse.java rename to backend/src/main/java/com/happy/friendogly/chatroom/dto/response/SaveChatRoomResponse.java index d498a13f5..1429fb7c6 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/SaveChatRoomResponse.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/dto/response/SaveChatRoomResponse.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.response; +package com.happy.friendogly.chatroom.dto.response; public record SaveChatRoomResponse(Long chatRoomId) { diff --git a/backend/src/main/java/com/happy/friendogly/chat/repository/ChatRoomMemberRepository.java b/backend/src/main/java/com/happy/friendogly/chatroom/repository/ChatRoomMemberRepository.java similarity index 67% rename from backend/src/main/java/com/happy/friendogly/chat/repository/ChatRoomMemberRepository.java rename to backend/src/main/java/com/happy/friendogly/chatroom/repository/ChatRoomMemberRepository.java index 2c97d800c..46f49200b 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/repository/ChatRoomMemberRepository.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/repository/ChatRoomMemberRepository.java @@ -1,6 +1,6 @@ -package com.happy.friendogly.chat.repository; +package com.happy.friendogly.chatroom.repository; -import com.happy.friendogly.chat.domain.ChatRoomMember; +import com.happy.friendogly.chatroom.domain.ChatRoomMember; import org.springframework.data.jpa.repository.JpaRepository; public interface ChatRoomMemberRepository extends JpaRepository { diff --git a/backend/src/main/java/com/happy/friendogly/chat/repository/ChatRoomRepository.java b/backend/src/main/java/com/happy/friendogly/chatroom/repository/ChatRoomRepository.java similarity index 88% rename from backend/src/main/java/com/happy/friendogly/chat/repository/ChatRoomRepository.java rename to backend/src/main/java/com/happy/friendogly/chatroom/repository/ChatRoomRepository.java index 3b0d45e05..f5cb50d7a 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/repository/ChatRoomRepository.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/repository/ChatRoomRepository.java @@ -1,6 +1,6 @@ -package com.happy.friendogly.chat.repository; +package com.happy.friendogly.chatroom.repository; -import com.happy.friendogly.chat.domain.ChatRoom; +import com.happy.friendogly.chatroom.domain.ChatRoom; import com.happy.friendogly.exception.FriendoglyException; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/backend/src/main/java/com/happy/friendogly/chat/service/ChatRoomCommandService.java b/backend/src/main/java/com/happy/friendogly/chatroom/service/ChatRoomCommandService.java similarity index 72% rename from backend/src/main/java/com/happy/friendogly/chat/service/ChatRoomCommandService.java rename to backend/src/main/java/com/happy/friendogly/chatroom/service/ChatRoomCommandService.java index 7aed86200..839df672e 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/service/ChatRoomCommandService.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/service/ChatRoomCommandService.java @@ -1,9 +1,10 @@ -package com.happy.friendogly.chat.service; +package com.happy.friendogly.chatroom.service; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.dto.request.SaveChatRoomRequest; -import com.happy.friendogly.chat.dto.response.SaveChatRoomResponse; -import com.happy.friendogly.chat.repository.ChatRoomRepository; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatroom.dto.request.SaveChatRoomRequest; +import com.happy.friendogly.chatroom.dto.response.SaveChatRoomResponse; +import com.happy.friendogly.chatroom.repository.ChatRoomRepository; +import com.happy.friendogly.chatsocket.service.ChatSocketCommandService; import com.happy.friendogly.member.domain.Member; import com.happy.friendogly.member.repository.MemberRepository; import java.util.List; @@ -18,16 +19,16 @@ public class ChatRoomCommandService { private final ChatRoomRepository chatRoomRepository; private final MemberRepository memberRepository; - private final ChatCommandService chatCommandService; + private final ChatSocketCommandService chatSocketCommandService; public ChatRoomCommandService( ChatRoomRepository chatRoomRepository, MemberRepository memberRepository, - ChatCommandService chatCommandService + ChatSocketCommandService chatSocketCommandService ) { this.chatRoomRepository = chatRoomRepository; this.memberRepository = memberRepository; - this.chatCommandService = chatCommandService; + this.chatSocketCommandService = chatSocketCommandService; } public SaveChatRoomResponse savePrivate(Long memberId, SaveChatRoomRequest request) { @@ -52,6 +53,6 @@ public void leave(Long memberId, Long chatRoomId) { Member member = memberRepository.getById(memberId); chatRoom.removeMember(member); - chatCommandService.sendLeave(memberId, chatRoomId); + chatSocketCommandService.sendLeave(memberId, chatRoomId); } } diff --git a/backend/src/main/java/com/happy/friendogly/chat/service/ChatRoomQueryService.java b/backend/src/main/java/com/happy/friendogly/chatroom/service/ChatRoomQueryService.java similarity index 85% rename from backend/src/main/java/com/happy/friendogly/chat/service/ChatRoomQueryService.java rename to backend/src/main/java/com/happy/friendogly/chatroom/service/ChatRoomQueryService.java index 8af5d9dba..f91e2273b 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/service/ChatRoomQueryService.java +++ b/backend/src/main/java/com/happy/friendogly/chatroom/service/ChatRoomQueryService.java @@ -1,12 +1,12 @@ -package com.happy.friendogly.chat.service; +package com.happy.friendogly.chatroom.service; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.dto.request.InviteToChatRoomRequest; -import com.happy.friendogly.chat.dto.response.ChatRoomDetail; -import com.happy.friendogly.chat.dto.response.FindChatRoomMembersInfoResponse; -import com.happy.friendogly.chat.dto.response.FindClubDetailsResponse; -import com.happy.friendogly.chat.dto.response.FindMyChatRoomResponse; -import com.happy.friendogly.chat.repository.ChatRoomRepository; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatroom.dto.request.InviteToChatRoomRequest; +import com.happy.friendogly.chatroom.dto.response.ChatRoomDetail; +import com.happy.friendogly.chatroom.dto.response.FindChatRoomMembersInfoResponse; +import com.happy.friendogly.chatroom.dto.response.FindClubDetailsResponse; +import com.happy.friendogly.chatroom.dto.response.FindMyChatRoomResponse; +import com.happy.friendogly.chatroom.repository.ChatRoomRepository; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.club.repository.ClubRepository; import com.happy.friendogly.exception.FriendoglyException; diff --git a/backend/src/main/java/com/happy/friendogly/config/RabbitMqConfig.java b/backend/src/main/java/com/happy/friendogly/chatsocket/config/RabbitMqConfig.java similarity index 98% rename from backend/src/main/java/com/happy/friendogly/config/RabbitMqConfig.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/config/RabbitMqConfig.java index e4d52fb03..d15810913 100644 --- a/backend/src/main/java/com/happy/friendogly/config/RabbitMqConfig.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/config/RabbitMqConfig.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.config; +package com.happy.friendogly.chatsocket.config; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/backend/src/main/java/com/happy/friendogly/config/WebSocketErrorHandler.java b/backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketErrorHandler.java similarity index 97% rename from backend/src/main/java/com/happy/friendogly/config/WebSocketErrorHandler.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketErrorHandler.java index 3a66a9cb5..c1545495c 100644 --- a/backend/src/main/java/com/happy/friendogly/config/WebSocketErrorHandler.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketErrorHandler.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.config; +package com.happy.friendogly.chatsocket.config; import static com.happy.friendogly.common.ErrorCode.DEFAULT_ERROR_CODE; import static org.springframework.messaging.simp.stomp.StompCommand.ERROR; diff --git a/backend/src/main/java/com/happy/friendogly/config/WebSocketInterceptor.java b/backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketInterceptor.java similarity index 95% rename from backend/src/main/java/com/happy/friendogly/config/WebSocketInterceptor.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketInterceptor.java index b781ab729..f10e51f82 100644 --- a/backend/src/main/java/com/happy/friendogly/config/WebSocketInterceptor.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketInterceptor.java @@ -1,12 +1,12 @@ -package com.happy.friendogly.config; +package com.happy.friendogly.chatsocket.config; import static org.springframework.http.HttpHeaders.AUTHORIZATION; import static org.springframework.messaging.simp.stomp.StompCommand.SUBSCRIBE; import com.happy.friendogly.auth.service.jwt.JwtProvider; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.repository.ChatRoomMemberRepository; -import com.happy.friendogly.chat.repository.ChatRoomRepository; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatroom.repository.ChatRoomMemberRepository; +import com.happy.friendogly.chatroom.repository.ChatRoomRepository; import com.happy.friendogly.club.repository.ClubRepository; import com.happy.friendogly.exception.FriendoglyException; import com.happy.friendogly.exception.FriendoglyWebSocketException; diff --git a/backend/src/main/java/com/happy/friendogly/config/WebSocketLocalConfig.java b/backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketLocalConfig.java similarity index 97% rename from backend/src/main/java/com/happy/friendogly/config/WebSocketLocalConfig.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketLocalConfig.java index f797dc4ee..b3e43a205 100644 --- a/backend/src/main/java/com/happy/friendogly/config/WebSocketLocalConfig.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketLocalConfig.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.config; +package com.happy.friendogly.chatsocket.config; import com.happy.friendogly.auth.WebSocketArgumentResolver; import com.happy.friendogly.auth.service.jwt.JwtProvider; diff --git a/backend/src/main/java/com/happy/friendogly/config/WebSocketRabbitMqConfig.java b/backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketRabbitMqConfig.java similarity index 98% rename from backend/src/main/java/com/happy/friendogly/config/WebSocketRabbitMqConfig.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketRabbitMqConfig.java index 20c624202..cdabc51a6 100644 --- a/backend/src/main/java/com/happy/friendogly/config/WebSocketRabbitMqConfig.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/config/WebSocketRabbitMqConfig.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.config; +package com.happy.friendogly.chatsocket.config; import com.happy.friendogly.auth.WebSocketArgumentResolver; import com.happy.friendogly.auth.service.jwt.JwtProvider; diff --git a/backend/src/main/java/com/happy/friendogly/chat/controller/ChatSocketController.java b/backend/src/main/java/com/happy/friendogly/chatsocket/controller/ChatSocketController.java similarity index 77% rename from backend/src/main/java/com/happy/friendogly/chat/controller/ChatSocketController.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/controller/ChatSocketController.java index 2d77d692c..48e21d15a 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/controller/ChatSocketController.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/controller/ChatSocketController.java @@ -1,11 +1,10 @@ -package com.happy.friendogly.chat.controller; +package com.happy.friendogly.chatsocket.controller; import com.happy.friendogly.auth.WebSocketAuth; -import com.happy.friendogly.chat.dto.request.ChatMessageSocketRequest; -import com.happy.friendogly.chat.dto.request.InviteToChatRoomRequest; -import com.happy.friendogly.chat.dto.response.InviteToChatRoomResponse; -import com.happy.friendogly.chat.service.ChatCommandService; -import com.happy.friendogly.chat.service.ChatRoomQueryService; +import com.happy.friendogly.chatsocket.dto.request.ChatMessageSocketRequest; +import com.happy.friendogly.chatroom.dto.request.InviteToChatRoomRequest; +import com.happy.friendogly.chatsocket.service.ChatSocketCommandService; +import com.happy.friendogly.chatroom.service.ChatRoomQueryService; import com.happy.friendogly.common.ApiResponse; import com.happy.friendogly.common.ErrorCode; import com.happy.friendogly.common.ErrorResponse; @@ -21,14 +20,14 @@ @RestController public class ChatSocketController { - private final ChatCommandService chatCommandService; + private final ChatSocketCommandService chatSocketCommandService; private final ChatRoomQueryService chatRoomQueryService; public ChatSocketController( - ChatCommandService chatCommandService, + ChatSocketCommandService chatSocketCommandService, ChatRoomQueryService chatRoomQueryService ) { - this.chatCommandService = chatCommandService; + this.chatSocketCommandService = chatSocketCommandService; this.chatRoomQueryService = chatRoomQueryService; } @@ -50,7 +49,7 @@ public void sendMessage( @DestinationVariable(value = "chatRoomId") Long chatRoomId, @Payload ChatMessageSocketRequest request ) { - chatCommandService.sendChat(memberId, chatRoomId, request); + chatSocketCommandService.sendChat(memberId, chatRoomId, request); } @MessageExceptionHandler diff --git a/backend/src/main/java/com/happy/friendogly/chat/domain/MessageType.java b/backend/src/main/java/com/happy/friendogly/chatsocket/domain/MessageType.java similarity index 59% rename from backend/src/main/java/com/happy/friendogly/chat/domain/MessageType.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/domain/MessageType.java index 549a720d1..e9728dcd7 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/domain/MessageType.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/domain/MessageType.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.domain; +package com.happy.friendogly.chatsocket.domain; public enum MessageType { diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/request/ChatMessageSocketRequest.java b/backend/src/main/java/com/happy/friendogly/chatsocket/dto/request/ChatMessageSocketRequest.java similarity index 53% rename from backend/src/main/java/com/happy/friendogly/chat/dto/request/ChatMessageSocketRequest.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/dto/request/ChatMessageSocketRequest.java index febe3d504..f73fbe4fd 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/request/ChatMessageSocketRequest.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/dto/request/ChatMessageSocketRequest.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.dto.request; +package com.happy.friendogly.chatsocket.dto.request; public record ChatMessageSocketRequest(String content) { diff --git a/backend/src/main/java/com/happy/friendogly/chat/dto/response/ChatMessageSocketResponse.java b/backend/src/main/java/com/happy/friendogly/chatsocket/dto/response/ChatMessageSocketResponse.java similarity index 86% rename from backend/src/main/java/com/happy/friendogly/chat/dto/response/ChatMessageSocketResponse.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/dto/response/ChatMessageSocketResponse.java index 344868de7..76f34e640 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/dto/response/ChatMessageSocketResponse.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/dto/response/ChatMessageSocketResponse.java @@ -1,6 +1,6 @@ -package com.happy.friendogly.chat.dto.response; +package com.happy.friendogly.chatsocket.dto.response; -import com.happy.friendogly.chat.domain.MessageType; +import com.happy.friendogly.chatsocket.domain.MessageType; import com.happy.friendogly.member.domain.Member; import java.time.LocalDateTime; diff --git a/backend/src/main/java/com/happy/friendogly/chat/service/ChatCommandService.java b/backend/src/main/java/com/happy/friendogly/chatsocket/service/ChatSocketCommandService.java similarity index 78% rename from backend/src/main/java/com/happy/friendogly/chat/service/ChatCommandService.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/service/ChatSocketCommandService.java index 43e52c6e2..d78812b52 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/service/ChatCommandService.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/service/ChatSocketCommandService.java @@ -1,17 +1,17 @@ -package com.happy.friendogly.chat.service; +package com.happy.friendogly.chatsocket.service; -import static com.happy.friendogly.chat.domain.MessageType.CHAT; -import static com.happy.friendogly.chat.domain.MessageType.ENTER; -import static com.happy.friendogly.chat.domain.MessageType.LEAVE; +import static com.happy.friendogly.chatsocket.domain.MessageType.CHAT; +import static com.happy.friendogly.chatsocket.domain.MessageType.ENTER; +import static com.happy.friendogly.chatsocket.domain.MessageType.LEAVE; -import com.happy.friendogly.chat.config.ChatTemplate; -import com.happy.friendogly.chat.domain.ChatMessage; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.domain.MessageType; -import com.happy.friendogly.chat.dto.request.ChatMessageSocketRequest; -import com.happy.friendogly.chat.dto.response.ChatMessageSocketResponse; -import com.happy.friendogly.chat.repository.ChatMessageRepository; -import com.happy.friendogly.chat.repository.ChatRoomRepository; +import com.happy.friendogly.chatsocket.template.ChatTemplate; +import com.happy.friendogly.chatmessage.domain.ChatMessage; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatsocket.domain.MessageType; +import com.happy.friendogly.chatsocket.dto.request.ChatMessageSocketRequest; +import com.happy.friendogly.chatsocket.dto.response.ChatMessageSocketResponse; +import com.happy.friendogly.chatmessage.repository.ChatMessageRepository; +import com.happy.friendogly.chatroom.repository.ChatRoomRepository; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.club.repository.ClubRepository; import com.happy.friendogly.exception.FriendoglyException; @@ -24,7 +24,7 @@ @Service @Transactional -public class ChatCommandService { +public class ChatSocketCommandService { private static final String EMPTY_CONTENT = ""; @@ -35,7 +35,7 @@ public class ChatCommandService { private final NotificationService notificationService; private final ChatTemplate template; - public ChatCommandService( + public ChatSocketCommandService( MemberRepository memberRepository, ClubRepository clubRepository, ChatRoomRepository chatRoomRepository, diff --git a/backend/src/main/java/com/happy/friendogly/chat/config/ChatTemplate.java b/backend/src/main/java/com/happy/friendogly/chatsocket/template/ChatTemplate.java similarity index 65% rename from backend/src/main/java/com/happy/friendogly/chat/config/ChatTemplate.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/template/ChatTemplate.java index f82a53b2c..ae8118720 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/config/ChatTemplate.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/template/ChatTemplate.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.config; +package com.happy.friendogly.chatsocket.template; public interface ChatTemplate { diff --git a/backend/src/main/java/com/happy/friendogly/chat/config/InMemoryChatTemplate.java b/backend/src/main/java/com/happy/friendogly/chatsocket/template/InMemoryChatTemplate.java similarity index 93% rename from backend/src/main/java/com/happy/friendogly/chat/config/InMemoryChatTemplate.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/template/InMemoryChatTemplate.java index b02fe0ba4..4423b204e 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/config/InMemoryChatTemplate.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/template/InMemoryChatTemplate.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.config; +package com.happy.friendogly.chatsocket.template; import org.springframework.context.annotation.Profile; import org.springframework.messaging.simp.SimpMessagingTemplate; diff --git a/backend/src/main/java/com/happy/friendogly/chat/config/RabbitChatTemplate.java b/backend/src/main/java/com/happy/friendogly/chatsocket/template/RabbitChatTemplate.java similarity index 92% rename from backend/src/main/java/com/happy/friendogly/chat/config/RabbitChatTemplate.java rename to backend/src/main/java/com/happy/friendogly/chatsocket/template/RabbitChatTemplate.java index efe554c3f..3ba46d29a 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/config/RabbitChatTemplate.java +++ b/backend/src/main/java/com/happy/friendogly/chatsocket/template/RabbitChatTemplate.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.config; +package com.happy.friendogly.chatsocket.template; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.context.annotation.Profile; diff --git a/backend/src/main/java/com/happy/friendogly/club/domain/Club.java b/backend/src/main/java/com/happy/friendogly/club/domain/Club.java index f4cbec82d..7ef282572 100644 --- a/backend/src/main/java/com/happy/friendogly/club/domain/Club.java +++ b/backend/src/main/java/com/happy/friendogly/club/domain/Club.java @@ -1,6 +1,6 @@ package com.happy.friendogly.club.domain; -import com.happy.friendogly.chat.domain.ChatRoom; +import com.happy.friendogly.chatroom.domain.ChatRoom; import com.happy.friendogly.exception.FriendoglyException; import com.happy.friendogly.member.domain.Member; import com.happy.friendogly.member.domain.Name; diff --git a/backend/src/main/java/com/happy/friendogly/club/service/ClubCommandService.java b/backend/src/main/java/com/happy/friendogly/club/service/ClubCommandService.java index 2446318d5..092477610 100644 --- a/backend/src/main/java/com/happy/friendogly/club/service/ClubCommandService.java +++ b/backend/src/main/java/com/happy/friendogly/club/service/ClubCommandService.java @@ -1,7 +1,7 @@ package com.happy.friendogly.club.service; -import com.happy.friendogly.chat.service.ChatCommandService; +import com.happy.friendogly.chatsocket.service.ChatSocketCommandService; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.club.dto.request.DeleteKickedMemberRequest; import com.happy.friendogly.club.dto.request.SaveClubMemberRequest; @@ -33,20 +33,20 @@ public class ClubCommandService { private final MemberRepository memberRepository; private final PetRepository petRepository; private final FileStorageManager fileStorageManager; - private final ChatCommandService chatCommandService; + private final ChatSocketCommandService chatSocketCommandService; public ClubCommandService( ClubRepository clubRepository, MemberRepository memberRepository, PetRepository petRepository, FileStorageManager fileStorageManager, - ChatCommandService chatCommandService + ChatSocketCommandService chatSocketCommandService ) { this.clubRepository = clubRepository; this.memberRepository = memberRepository; this.petRepository = petRepository; this.fileStorageManager = fileStorageManager; - this.chatCommandService = chatCommandService; + this.chatSocketCommandService = chatSocketCommandService; } public SaveClubResponse save(Long memberId, MultipartFile image, SaveClubRequest request) { @@ -83,7 +83,7 @@ public SaveClubMemberResponse joinClub(Long clubId, Long memberId, SaveClubMembe club.addClubPet(mapToPets(request.participatingPetsId(), member)); club.addChatRoomMember(member); - chatCommandService.sendEnter(memberId, club.getChatRoom().getId()); + chatSocketCommandService.sendEnter(memberId, club.getChatRoom().getId()); return new SaveClubMemberResponse(memberId, club.getChatRoom().getId()); } diff --git a/backend/src/main/java/com/happy/friendogly/notification/service/FakeNotificationService.java b/backend/src/main/java/com/happy/friendogly/notification/service/FakeNotificationService.java index c194617e7..be48016df 100644 --- a/backend/src/main/java/com/happy/friendogly/notification/service/FakeNotificationService.java +++ b/backend/src/main/java/com/happy/friendogly/notification/service/FakeNotificationService.java @@ -1,6 +1,6 @@ package com.happy.friendogly.notification.service; -import com.happy.friendogly.chat.dto.response.ChatMessageSocketResponse; +import com.happy.friendogly.chatsocket.dto.response.ChatMessageSocketResponse; import com.happy.friendogly.club.domain.Club; import java.util.List; import org.springframework.context.annotation.Profile; diff --git a/backend/src/main/java/com/happy/friendogly/notification/service/FcmNotificationService.java b/backend/src/main/java/com/happy/friendogly/notification/service/FcmNotificationService.java index 133916a9c..60936079d 100644 --- a/backend/src/main/java/com/happy/friendogly/notification/service/FcmNotificationService.java +++ b/backend/src/main/java/com/happy/friendogly/notification/service/FcmNotificationService.java @@ -9,7 +9,7 @@ import com.google.firebase.messaging.FirebaseMessaging; import com.google.firebase.messaging.FirebaseMessagingException; import com.google.firebase.messaging.MulticastMessage; -import com.happy.friendogly.chat.dto.response.ChatMessageSocketResponse; +import com.happy.friendogly.chatsocket.dto.response.ChatMessageSocketResponse; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.exception.FriendoglyException; import com.happy.friendogly.notification.domain.NotificationType; diff --git a/backend/src/main/java/com/happy/friendogly/notification/service/NotificationService.java b/backend/src/main/java/com/happy/friendogly/notification/service/NotificationService.java index 0f541d371..d1b053427 100644 --- a/backend/src/main/java/com/happy/friendogly/notification/service/NotificationService.java +++ b/backend/src/main/java/com/happy/friendogly/notification/service/NotificationService.java @@ -1,6 +1,6 @@ package com.happy.friendogly.notification.service; -import com.happy.friendogly.chat.dto.response.ChatMessageSocketResponse; +import com.happy.friendogly.chatsocket.dto.response.ChatMessageSocketResponse; import com.happy.friendogly.club.domain.Club; import java.util.List; diff --git a/backend/src/test/java/com/happy/friendogly/chat/controller/ChatMessageControllerTest.java b/backend/src/test/java/com/happy/friendogly/chatmessage/controller/ChatMessageControllerTest.java similarity index 84% rename from backend/src/test/java/com/happy/friendogly/chat/controller/ChatMessageControllerTest.java rename to backend/src/test/java/com/happy/friendogly/chatmessage/controller/ChatMessageControllerTest.java index ebb8323e3..0f23a170a 100644 --- a/backend/src/test/java/com/happy/friendogly/chat/controller/ChatMessageControllerTest.java +++ b/backend/src/test/java/com/happy/friendogly/chatmessage/controller/ChatMessageControllerTest.java @@ -1,11 +1,11 @@ -package com.happy.friendogly.chat.controller; +package com.happy.friendogly.chatmessage.controller; import static org.hamcrest.Matchers.contains; -import com.happy.friendogly.chat.domain.MessageType; -import com.happy.friendogly.chat.dto.request.FindMessagesByTimeRangeRequest; -import com.happy.friendogly.chat.dto.response.FindChatMessagesResponse; -import com.happy.friendogly.chat.service.ChatQueryService; +import com.happy.friendogly.chatsocket.domain.MessageType; +import com.happy.friendogly.chatmessage.dto.request.FindMessagesByTimeRangeRequest; +import com.happy.friendogly.chatmessage.dto.response.FindChatMessagesResponse; +import com.happy.friendogly.chatmessage.service.ChatMessageQueryService; import com.happy.friendogly.support.ControllerTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; @@ -21,7 +21,7 @@ class ChatMessageControllerTest extends ControllerTest { @MockBean - private ChatQueryService chatQueryService; + private ChatMessageQueryService chatMessageQueryService; @DisplayName("두 시점 사이의 채팅 메시지를 조회할 수 있다.") @Test @@ -31,7 +31,7 @@ void name() { LocalDateTime.parse("2022-01-01T11:02:00.12345") ); - Mockito.when(chatQueryService.findByTimeRange(1L, 1L, request)) + Mockito.when(chatMessageQueryService.findByTimeRange(1L, 1L, request)) .thenReturn(List.of( new FindChatMessagesResponse( MessageType.CHAT, diff --git a/backend/src/test/java/com/happy/friendogly/chat/service/ChatRoomCommandServiceTest.java b/backend/src/test/java/com/happy/friendogly/chatroom/service/ChatRoomCommandServiceTest.java similarity index 94% rename from backend/src/test/java/com/happy/friendogly/chat/service/ChatRoomCommandServiceTest.java rename to backend/src/test/java/com/happy/friendogly/chatroom/service/ChatRoomCommandServiceTest.java index f933f578b..f363daee6 100644 --- a/backend/src/test/java/com/happy/friendogly/chat/service/ChatRoomCommandServiceTest.java +++ b/backend/src/test/java/com/happy/friendogly/chatroom/service/ChatRoomCommandServiceTest.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.service; +package com.happy.friendogly.chatroom.service; import static com.happy.friendogly.pet.domain.Gender.FEMALE; import static com.happy.friendogly.pet.domain.Gender.FEMALE_NEUTERED; @@ -8,9 +8,10 @@ import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.dto.request.SaveChatRoomRequest; -import com.happy.friendogly.chat.dto.response.SaveChatRoomResponse; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatroom.dto.request.SaveChatRoomRequest; +import com.happy.friendogly.chatroom.dto.response.SaveChatRoomResponse; +import com.happy.friendogly.chatroom.service.ChatRoomCommandService; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.club.dto.request.SaveClubMemberRequest; import com.happy.friendogly.club.service.ClubCommandService; diff --git a/backend/src/test/java/com/happy/friendogly/chat/service/ChatRoomQueryServiceTest.java b/backend/src/test/java/com/happy/friendogly/chatroom/service/ChatRoomQueryServiceTest.java similarity index 93% rename from backend/src/test/java/com/happy/friendogly/chat/service/ChatRoomQueryServiceTest.java rename to backend/src/test/java/com/happy/friendogly/chatroom/service/ChatRoomQueryServiceTest.java index ee3edad20..3b6a02d41 100644 --- a/backend/src/test/java/com/happy/friendogly/chat/service/ChatRoomQueryServiceTest.java +++ b/backend/src/test/java/com/happy/friendogly/chatroom/service/ChatRoomQueryServiceTest.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.service; +package com.happy.friendogly.chatroom.service; import static com.happy.friendogly.pet.domain.Gender.FEMALE; import static com.happy.friendogly.pet.domain.Gender.FEMALE_NEUTERED; @@ -11,11 +11,12 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertAll; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.dto.response.ChatRoomDetail; -import com.happy.friendogly.chat.dto.response.FindChatRoomMembersInfoResponse; -import com.happy.friendogly.chat.dto.response.FindClubDetailsResponse; -import com.happy.friendogly.chat.dto.response.FindMyChatRoomResponse; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatroom.dto.response.ChatRoomDetail; +import com.happy.friendogly.chatroom.dto.response.FindChatRoomMembersInfoResponse; +import com.happy.friendogly.chatroom.dto.response.FindClubDetailsResponse; +import com.happy.friendogly.chatroom.dto.response.FindMyChatRoomResponse; +import com.happy.friendogly.chatroom.service.ChatRoomQueryService; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.exception.FriendoglyException; import com.happy.friendogly.member.domain.Member; diff --git a/backend/src/test/java/com/happy/friendogly/chat/service/ChatQueryServiceTest.java b/backend/src/test/java/com/happy/friendogly/chatsocket/service/ChatMessageQueryServiceTest.java similarity index 84% rename from backend/src/test/java/com/happy/friendogly/chat/service/ChatQueryServiceTest.java rename to backend/src/test/java/com/happy/friendogly/chatsocket/service/ChatMessageQueryServiceTest.java index 5d9a1daea..5d8740a25 100644 --- a/backend/src/test/java/com/happy/friendogly/chat/service/ChatQueryServiceTest.java +++ b/backend/src/test/java/com/happy/friendogly/chatsocket/service/ChatMessageQueryServiceTest.java @@ -1,4 +1,4 @@ -package com.happy.friendogly.chat.service; +package com.happy.friendogly.chatsocket.service; import static com.happy.friendogly.pet.domain.Gender.FEMALE; import static com.happy.friendogly.pet.domain.Gender.FEMALE_NEUTERED; @@ -10,9 +10,10 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.dto.request.FindMessagesByTimeRangeRequest; -import com.happy.friendogly.chat.dto.response.FindChatMessagesResponse; +import com.happy.friendogly.chatmessage.service.ChatMessageQueryService; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatmessage.dto.request.FindMessagesByTimeRangeRequest; +import com.happy.friendogly.chatmessage.dto.response.FindChatMessagesResponse; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.exception.FriendoglyException; import com.happy.friendogly.member.domain.Member; @@ -28,10 +29,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -class ChatQueryServiceTest extends ServiceTest { +class ChatMessageQueryServiceTest extends ServiceTest { @Autowired - private ChatQueryService chatQueryService; + private ChatMessageQueryService chatMessageQueryService; private Member member; private ChatRoom chatRoom; @@ -60,7 +61,7 @@ void findAllByChatRoomId_Fail_Unauthorized() { // when - then assertThatThrownBy( - () -> chatQueryService.findAllByChatRoomId(otherMember.getId(), chatRoom.getId())).isInstanceOf( + () -> chatMessageQueryService.findAllByChatRoomId(otherMember.getId(), chatRoom.getId())).isInstanceOf( FriendoglyException.class).hasMessage("채팅 내역을 조회할 수 있는 권한이 없습니다."); } @@ -85,7 +86,7 @@ INSERT INTO chat_message (chat_room_id, message_type, member_id, content, create FindMessagesByTimeRangeRequest request = new FindMessagesByTimeRangeRequest( LocalDateTime.parse("2024-01-01T10:00:00"), LocalDateTime.parse("2024-01-01T13:00:00")); - List response = chatQueryService.findByTimeRange(member.getId(), chatRoom.getId(), + List response = chatMessageQueryService.findByTimeRange(member.getId(), chatRoom.getId(), request); // then @@ -101,7 +102,7 @@ void findAllByTimeRange_Fail_InvalidTimeRange() { // when & then assertThatThrownBy( - () -> chatQueryService.findByTimeRange(member.getId(), chatRoom.getId(), request)).isInstanceOf( + () -> chatMessageQueryService.findByTimeRange(member.getId(), chatRoom.getId(), request)).isInstanceOf( FriendoglyException.class).hasMessage("since 시간을 until 시간보다 과거로 설정해 주세요."); } } diff --git a/backend/src/test/java/com/happy/friendogly/chat/service/ChatCommandServiceTest.java b/backend/src/test/java/com/happy/friendogly/chatsocket/service/ChatSocketCommandServiceTest.java similarity index 79% rename from backend/src/test/java/com/happy/friendogly/chat/service/ChatCommandServiceTest.java rename to backend/src/test/java/com/happy/friendogly/chatsocket/service/ChatSocketCommandServiceTest.java index 0d370dfdc..13587dc0b 100644 --- a/backend/src/test/java/com/happy/friendogly/chat/service/ChatCommandServiceTest.java +++ b/backend/src/test/java/com/happy/friendogly/chatsocket/service/ChatSocketCommandServiceTest.java @@ -1,13 +1,13 @@ -package com.happy.friendogly.chat.service; +package com.happy.friendogly.chatsocket.service; -import static com.happy.friendogly.chat.domain.MessageType.ENTER; -import static com.happy.friendogly.chat.domain.MessageType.LEAVE; +import static com.happy.friendogly.chatsocket.domain.MessageType.ENTER; +import static com.happy.friendogly.chatsocket.domain.MessageType.LEAVE; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; -import com.happy.friendogly.chat.domain.ChatMessage; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.dto.request.ChatMessageSocketRequest; +import com.happy.friendogly.chatmessage.domain.ChatMessage; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatsocket.dto.request.ChatMessageSocketRequest; import com.happy.friendogly.club.domain.Club; import com.happy.friendogly.member.domain.Member; import com.happy.friendogly.pet.domain.Gender; @@ -23,10 +23,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -class ChatCommandServiceTest extends ServiceTest { +class ChatSocketCommandServiceTest extends ServiceTest { @Autowired - private ChatCommandService chatCommandService; + private ChatSocketCommandService chatSocketCommandService; private Member member; private ChatRoom chatRoom; @@ -48,7 +48,7 @@ void setUp() { @Test void enter_SaveDatabase() { // when - chatCommandService.sendEnter(member.getId(), chatRoom.getId()); + chatSocketCommandService.sendEnter(member.getId(), chatRoom.getId()); // then List messages = chatMessageRepository.findAll(); @@ -68,7 +68,7 @@ void send_SaveDatabase() { ChatMessageSocketRequest request = new ChatMessageSocketRequest("반갑습니다."); // when - chatCommandService.sendChat(member.getId(), chatRoom.getId(), request); + chatSocketCommandService.sendChat(member.getId(), chatRoom.getId(), request); // then List messages = chatMessageRepository.findAll(); @@ -81,7 +81,7 @@ void send_SaveDatabase() { @Test void leave_SaveDatabase() { // when - chatCommandService.sendLeave(member.getId(), chatRoom.getId()); + chatSocketCommandService.sendLeave(member.getId(), chatRoom.getId()); // then List messages = chatMessageRepository.findAll(); diff --git a/backend/src/test/java/com/happy/friendogly/docs/ChatMessageApiDocsTest.java b/backend/src/test/java/com/happy/friendogly/docs/ChatMessageApiDocsTest.java index 40d99b2dc..6867a16a6 100644 --- a/backend/src/test/java/com/happy/friendogly/docs/ChatMessageApiDocsTest.java +++ b/backend/src/test/java/com/happy/friendogly/docs/ChatMessageApiDocsTest.java @@ -15,11 +15,11 @@ import com.epages.restdocs.apispec.ResourceSnippetParameters; import com.epages.restdocs.apispec.Schema; -import com.happy.friendogly.chat.controller.ChatMessageController; -import com.happy.friendogly.chat.domain.MessageType; -import com.happy.friendogly.chat.dto.request.FindMessagesByTimeRangeRequest; -import com.happy.friendogly.chat.dto.response.FindChatMessagesResponse; -import com.happy.friendogly.chat.service.ChatQueryService; +import com.happy.friendogly.chatmessage.controller.ChatMessageController; +import com.happy.friendogly.chatsocket.domain.MessageType; +import com.happy.friendogly.chatmessage.dto.request.FindMessagesByTimeRangeRequest; +import com.happy.friendogly.chatmessage.dto.response.FindChatMessagesResponse; +import com.happy.friendogly.chatmessage.service.ChatMessageQueryService; import java.time.LocalDateTime; import java.util.List; import org.junit.jupiter.api.DisplayName; @@ -30,7 +30,7 @@ public class ChatMessageApiDocsTest extends RestDocsTest { @Mock - private ChatQueryService chatQueryService; + private ChatMessageQueryService chatMessageQueryService; @DisplayName("채팅방의 모든 채팅 내역 조회") @Test @@ -70,7 +70,7 @@ void findAllByChatRoomId() throws Exception { ) ); - given(chatQueryService.findAllByChatRoomId(anyLong(), anyLong())) + given(chatMessageQueryService.findAllByChatRoomId(anyLong(), anyLong())) .willReturn(response); mockMvc @@ -127,7 +127,7 @@ void findRecent() throws Exception { ) ); - given(chatQueryService.findByTimeRange(anyLong(), anyLong(), any(FindMessagesByTimeRangeRequest.class))) + given(chatMessageQueryService.findByTimeRange(anyLong(), anyLong(), any(FindMessagesByTimeRangeRequest.class))) .willReturn(response); mockMvc @@ -167,6 +167,6 @@ void findRecent() throws Exception { @Override protected Object controller() { - return new ChatMessageController(chatQueryService); + return new ChatMessageController(chatMessageQueryService); } } diff --git a/backend/src/test/java/com/happy/friendogly/docs/ChatRoomApiDocsTest.java b/backend/src/test/java/com/happy/friendogly/docs/ChatRoomApiDocsTest.java index b14c0271e..5e8fcd99d 100644 --- a/backend/src/test/java/com/happy/friendogly/docs/ChatRoomApiDocsTest.java +++ b/backend/src/test/java/com/happy/friendogly/docs/ChatRoomApiDocsTest.java @@ -21,15 +21,15 @@ import com.epages.restdocs.apispec.ResourceSnippetParameters; import com.epages.restdocs.apispec.Schema; -import com.happy.friendogly.chat.controller.ChatRoomController; -import com.happy.friendogly.chat.dto.request.SaveChatRoomRequest; -import com.happy.friendogly.chat.dto.response.ChatRoomDetail; -import com.happy.friendogly.chat.dto.response.FindChatRoomMembersInfoResponse; -import com.happy.friendogly.chat.dto.response.FindClubDetailsResponse; -import com.happy.friendogly.chat.dto.response.FindMyChatRoomResponse; -import com.happy.friendogly.chat.dto.response.SaveChatRoomResponse; -import com.happy.friendogly.chat.service.ChatRoomCommandService; -import com.happy.friendogly.chat.service.ChatRoomQueryService; +import com.happy.friendogly.chatroom.controller.ChatRoomController; +import com.happy.friendogly.chatroom.dto.request.SaveChatRoomRequest; +import com.happy.friendogly.chatroom.dto.response.ChatRoomDetail; +import com.happy.friendogly.chatroom.dto.response.FindChatRoomMembersInfoResponse; +import com.happy.friendogly.chatroom.dto.response.FindClubDetailsResponse; +import com.happy.friendogly.chatroom.dto.response.FindMyChatRoomResponse; +import com.happy.friendogly.chatroom.dto.response.SaveChatRoomResponse; +import com.happy.friendogly.chatroom.service.ChatRoomCommandService; +import com.happy.friendogly.chatroom.service.ChatRoomQueryService; import java.util.List; import java.util.Set; import org.junit.jupiter.api.DisplayName; diff --git a/backend/src/test/java/com/happy/friendogly/notification/repository/DeviceTokenRepositoryTest.java b/backend/src/test/java/com/happy/friendogly/notification/repository/DeviceTokenRepositoryTest.java index 97619204f..e960766bd 100644 --- a/backend/src/test/java/com/happy/friendogly/notification/repository/DeviceTokenRepositoryTest.java +++ b/backend/src/test/java/com/happy/friendogly/notification/repository/DeviceTokenRepositoryTest.java @@ -2,8 +2,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.happy.friendogly.chat.domain.ChatRoom; -import com.happy.friendogly.chat.repository.ChatRoomRepository; +import com.happy.friendogly.chatroom.domain.ChatRoom; +import com.happy.friendogly.chatroom.repository.ChatRoomRepository; import com.happy.friendogly.member.domain.Member; import com.happy.friendogly.member.repository.MemberRepository; import com.happy.friendogly.notification.domain.DeviceToken; diff --git a/backend/src/test/java/com/happy/friendogly/support/ServiceTest.java b/backend/src/test/java/com/happy/friendogly/support/ServiceTest.java index b7fb74d1a..0ce31a7a9 100644 --- a/backend/src/test/java/com/happy/friendogly/support/ServiceTest.java +++ b/backend/src/test/java/com/happy/friendogly/support/ServiceTest.java @@ -1,7 +1,7 @@ package com.happy.friendogly.support; -import com.happy.friendogly.chat.repository.ChatMessageRepository; -import com.happy.friendogly.chat.repository.ChatRoomRepository; +import com.happy.friendogly.chatmessage.repository.ChatMessageRepository; +import com.happy.friendogly.chatroom.repository.ChatRoomRepository; import com.happy.friendogly.club.repository.ClubRepository; import com.happy.friendogly.footprint.repository.FootprintRepository; import com.happy.friendogly.member.repository.MemberRepository;