diff --git a/chat/src/main/java/org/bookwoori/chat/domain/channelMessage/entity/ChannelMessage.java b/chat/src/main/java/org/bookwoori/chat/domain/channelMessage/entity/ChannelMessage.java index 42d43111..a6c26834 100644 --- a/chat/src/main/java/org/bookwoori/chat/domain/channelMessage/entity/ChannelMessage.java +++ b/chat/src/main/java/org/bookwoori/chat/domain/channelMessage/entity/ChannelMessage.java @@ -1,8 +1,10 @@ package org.bookwoori.chat.domain.channelMessage.entity; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import lombok.AccessLevel; @@ -13,6 +15,7 @@ import org.bookwoori.chat.global.common.EmojiType; import org.bookwoori.chat.global.common.EventType; import org.bookwoori.chat.global.common.MessageType; +import org.bookwoori.chat.global.common.dto.MemberProfileDto; import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Transient; import org.springframework.data.mongodb.core.mapping.Document; @@ -46,6 +49,16 @@ public class ChannelMessage { /* * 데이터베이스에 저장되지 않는 필드 */ + + @Transient + private String nickname; + + @Transient + private String profileImg; + + @Transient + private List target = new ArrayList<>(); + @Transient private Long parentMemberId; @@ -77,6 +90,15 @@ public void modifyContent(String content) { this.modifiedAt = LocalDateTime.now(); } + public void setProfile(MemberProfileDto profile) { + this.nickname = profile.nickname(); + this.profileImg = profile.profileImg(); + } + + public void setTarget(List target) { + this.target = target; + } + public void setEventType(EventType eventType) { this.eventType = eventType; } diff --git a/chat/src/main/java/org/bookwoori/chat/domain/directMessage/entity/DirectMessage.java b/chat/src/main/java/org/bookwoori/chat/domain/directMessage/entity/DirectMessage.java index 24efa9f6..3cfed816 100644 --- a/chat/src/main/java/org/bookwoori/chat/domain/directMessage/entity/DirectMessage.java +++ b/chat/src/main/java/org/bookwoori/chat/domain/directMessage/entity/DirectMessage.java @@ -1,8 +1,10 @@ package org.bookwoori.chat.domain.directMessage.entity; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import lombok.AccessLevel; @@ -13,6 +15,7 @@ import org.bookwoori.chat.global.common.EmojiType; import org.bookwoori.chat.global.common.EventType; import org.bookwoori.chat.global.common.MessageType; +import org.bookwoori.chat.global.common.dto.MemberProfileDto; import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Transient; import org.springframework.data.mongodb.core.mapping.Document; @@ -46,6 +49,16 @@ public class DirectMessage { /* * 데이터베이스에 저장되지 않는 필드 */ + + @Transient + private String nickname; + + @Transient + private String profileImg; + + @Transient + private List target = new ArrayList<>(); + @Transient private Long parentMemberId; @@ -77,6 +90,15 @@ public void modifyContent(String content) { this.modifiedAt = LocalDateTime.now(); } + public void setProfile(MemberProfileDto profile) { + this.nickname = profile.nickname(); + this.profileImg = profile.profileImg(); + } + + public void setTarget(List target) { + this.target = target; + } + public void setEventType(EventType eventType) { this.eventType = eventType; } diff --git a/chat/src/main/java/org/bookwoori/chat/global/common/dto/MemberProfileDto.java b/chat/src/main/java/org/bookwoori/chat/global/common/dto/MemberProfileDto.java new file mode 100644 index 00000000..1afef7e7 --- /dev/null +++ b/chat/src/main/java/org/bookwoori/chat/global/common/dto/MemberProfileDto.java @@ -0,0 +1,8 @@ +package org.bookwoori.chat.global.common.dto; + +public record MemberProfileDto( + String nickname, + String profileImg +) { + +} diff --git a/chat/src/main/java/org/bookwoori/chat/global/feignClient/CoreClient.java b/chat/src/main/java/org/bookwoori/chat/global/feignClient/CoreClient.java index 22a9f124..a3193f60 100644 --- a/chat/src/main/java/org/bookwoori/chat/global/feignClient/CoreClient.java +++ b/chat/src/main/java/org/bookwoori/chat/global/feignClient/CoreClient.java @@ -1,8 +1,19 @@ package org.bookwoori.chat.global.feignClient; +import java.util.Map; +import org.bookwoori.chat.global.common.dto.MemberProfileDto; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; @FeignClient(name = "core", url = "${client.url.core}") public interface CoreClient { + @GetMapping("/messageRooms/{messageRoomId}/members") + Map getParticipantsByMessageRoom( + @PathVariable("messageRoomId") Long messageRoomId); + + @GetMapping("/channels/{channelId}/members") + Map getParticipantsByChannel( + @PathVariable("channelId") Long channelId); } diff --git a/chat/src/main/java/org/bookwoori/chat/global/feignClient/NotificationClient.java b/chat/src/main/java/org/bookwoori/chat/global/feignClient/NotificationClient.java new file mode 100644 index 00000000..4ccd0dad --- /dev/null +++ b/chat/src/main/java/org/bookwoori/chat/global/feignClient/NotificationClient.java @@ -0,0 +1,15 @@ +package org.bookwoori.chat.global.feignClient; + +import org.bookwoori.chat.global.feignClient.dto.MessageNotificationRequestDto; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; + +@FeignClient(name = "noti", url = "${client.url.notification}") +public interface NotificationClient { + + @PostMapping("notification-server/direct") + void sendDirectNotification(MessageNotificationRequestDto requestDto); + + @PostMapping("notification-server/chat") + void sendChannelNotification(MessageNotificationRequestDto requestDto); +} diff --git a/chat/src/main/java/org/bookwoori/chat/global/feignClient/dto/MessageNotificationRequestDto.java b/chat/src/main/java/org/bookwoori/chat/global/feignClient/dto/MessageNotificationRequestDto.java new file mode 100644 index 00000000..6e8ceb37 --- /dev/null +++ b/chat/src/main/java/org/bookwoori/chat/global/feignClient/dto/MessageNotificationRequestDto.java @@ -0,0 +1,49 @@ +package org.bookwoori.chat.global.feignClient.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import jakarta.validation.constraints.NotNull; +import lombok.Builder; +import org.bookwoori.chat.domain.channelMessage.entity.ChannelMessage; +import org.bookwoori.chat.domain.directMessage.entity.DirectMessage; + +@Builder +public record MessageNotificationRequestDto( + @NotNull + Long memberId, + @NotNull + String nickname, + @NotNull + String type, + @NotNull + String content, + @JsonInclude(Include.NON_NULL) + Long roomId, + @JsonInclude(Include.NON_NULL) + Long channelId, + @NotNull + String target +) { + + public static MessageNotificationRequestDto from(DirectMessage directMessage) { + return MessageNotificationRequestDto.builder() + .memberId(directMessage.getMemberId()) + .nickname(directMessage.getNickname()) + .type("directMessage") + .content(directMessage.getContent()) + .roomId(directMessage.getMessageRoomId()) + .target(directMessage.getTarget().toString()) + .build(); + } + + public static MessageNotificationRequestDto from(ChannelMessage channelMessage) { + return MessageNotificationRequestDto.builder() + .memberId(channelMessage.getMemberId()) + .nickname(channelMessage.getNickname()) + .type("channelMessage") + .content(channelMessage.getContent()) + .channelId(channelMessage.getChannelId()) + .target(channelMessage.getTarget().toString()) + .build(); + } +} diff --git a/chat/src/main/java/org/bookwoori/chat/global/kafka/MessageSender.java b/chat/src/main/java/org/bookwoori/chat/global/kafka/MessageSender.java index d1715a9a..8969feed 100644 --- a/chat/src/main/java/org/bookwoori/chat/global/kafka/MessageSender.java +++ b/chat/src/main/java/org/bookwoori/chat/global/kafka/MessageSender.java @@ -1,5 +1,8 @@ package org.bookwoori.chat.global.kafka; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.log4j.Log4j2; import org.bookwoori.chat.domain.channelMessage.dto.request.ChannelMessageDeleteRequestDto; @@ -19,8 +22,12 @@ import org.bookwoori.chat.global.common.ActionType; import org.bookwoori.chat.global.common.EventType; import org.bookwoori.chat.global.common.MessageType; +import org.bookwoori.chat.global.common.dto.MemberProfileDto; import org.bookwoori.chat.global.exception.CustomException; import org.bookwoori.chat.global.exception.ErrorCode; +import org.bookwoori.chat.global.feignClient.CoreClient; +import org.bookwoori.chat.global.feignClient.NotificationClient; +import org.bookwoori.chat.global.feignClient.dto.MessageNotificationRequestDto; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.stereotype.Component; @@ -32,10 +39,35 @@ public class MessageSender { //토픽에 이벤트를 발행 private final KafkaTemplate kafkaTemplate; private final DirectMessageRepository directMessageRepository; private final ChannelMessageRepository channelMessageRepository; + private final CoreClient coreClient; + private final NotificationClient notificationClient; public void sendDirectMessage(DirectMessageSendRequestDto requestDto, Long memberId) { DirectMessage directMessage = requestDto.toEntity(memberId); directMessageRepository.save(directMessage); + + try { + //알림 전송에 필요한 데이터 구성 + Map participants = coreClient.getParticipantsByMessageRoom( + requestDto.messageRoomId()); + List target = new ArrayList<>(); + for (Long key : participants.keySet()) { + if (key.equals(memberId)) { + continue; + } + target.add(key); + } + directMessage.setProfile(participants.get(directMessage.getMemberId())); + directMessage.setTarget(target); + + //알림 전송 + notificationClient.sendDirectNotification( + MessageNotificationRequestDto.from(directMessage)); + } catch (Exception e) { + log.error("Direct Message notification send Failed: {}", directMessage.getId()); + log.error(e.getMessage()); + } + kafkaTemplate.send(KafkaConstants.DIRECT_CHAT_TOPIC, directMessage); } @@ -98,6 +130,28 @@ public void deleteDirectMessage(DirectMessageDeleteRequestDto requestDto, Long m public void sendChannelMessage(ChannelMessageSendRequestDto requestDto, Long memberId) { ChannelMessage channelMessage = requestDto.toEntity(memberId); channelMessageRepository.save(channelMessage); + + try { + //알림 전송에 필요한 데이터 구성 + Map participants = coreClient.getParticipantsByChannel( + requestDto.channelId()); + List target = new ArrayList<>(); + for (Long key : participants.keySet()) { + if (key.equals(memberId)) { + continue; + } + target.add(key); + } + channelMessage.setProfile(participants.get(channelMessage.getMemberId())); + channelMessage.setTarget(target); + //알림 전송 + notificationClient.sendChannelNotification( + MessageNotificationRequestDto.from(channelMessage)); + } catch (Exception e) { + log.error("Channel Message notification send Failed: {}", channelMessage.getId()); + log.error(e.getMessage()); + } + kafkaTemplate.send(KafkaConstants.CHANNEL_CHAT_TOPIC, channelMessage); } diff --git a/core/src/main/java/org/bookwoori/core/domain/channel/controller/ChannelController.java b/core/src/main/java/org/bookwoori/core/domain/channel/controller/ChannelController.java index 37b59972..b8417103 100644 --- a/core/src/main/java/org/bookwoori/core/domain/channel/controller/ChannelController.java +++ b/core/src/main/java/org/bookwoori/core/domain/channel/controller/ChannelController.java @@ -10,6 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -46,4 +47,10 @@ public ResponseEntity updateChannelName(@PathVariable final Long channelId, channelFacade.modifyChannel(channelId, requestDto); return ResponseEntity.ok().build(); } + + //@Operation(summary = "(채팅) 채널 참여자 정보 조회", description = "(채팅) 채널에 참여하고 있는 회원들의 정보를 조회합니다.") + @GetMapping("/{channelId}/members") + public ResponseEntity getParticipants(@PathVariable final Long channelId) { + return ResponseEntity.ok(channelFacade.getParticipants(channelId)); + } } diff --git a/core/src/main/java/org/bookwoori/core/domain/channel/facade/ChannelFacade.java b/core/src/main/java/org/bookwoori/core/domain/channel/facade/ChannelFacade.java index d7a72a4e..c49ddeff 100644 --- a/core/src/main/java/org/bookwoori/core/domain/channel/facade/ChannelFacade.java +++ b/core/src/main/java/org/bookwoori/core/domain/channel/facade/ChannelFacade.java @@ -1,5 +1,8 @@ package org.bookwoori.core.domain.channel.facade; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import lombok.RequiredArgsConstructor; import org.bookwoori.core.domain.category.entity.Category; import org.bookwoori.core.domain.category.service.CategoryService; @@ -7,6 +10,10 @@ import org.bookwoori.core.domain.channel.dto.request.ChannelModifyRequestDto; import org.bookwoori.core.domain.channel.entity.Channel; import org.bookwoori.core.domain.channel.service.ChannelService; +import org.bookwoori.core.domain.member.dto.response.MemberProfileResponseDto; +import org.bookwoori.core.domain.member.entity.Member; +import org.bookwoori.core.domain.server.entity.Server; +import org.bookwoori.core.domain.serverMember.service.ServerMemberService; import org.bookwoori.core.global.exception.CustomException; import org.bookwoori.core.global.exception.ErrorCode; import org.springframework.stereotype.Component; @@ -18,6 +25,7 @@ public class ChannelFacade { private final ChannelService channelService; private final CategoryService categoryService; + private final ServerMemberService serverMemberService; @Transactional public void createChannel(ChannelCreateRequestDto requestDto) { @@ -54,4 +62,18 @@ public void deleteChannel(Long channelId) { channelService.detach(channel); channelService.deleteChannel(channel); } + + @Transactional(readOnly = true) + public Map getParticipants(Long channelId) { + Server server = channelService.getChannelById(channelId).getCategory().getServer(); + return createProfileMap(serverMemberService.getMembersByServer(server)); + } + + private Map createProfileMap(List members) { + Map map = new HashMap<>(); + for (Member member : members) { + map.put(member.getMemberId(), MemberProfileResponseDto.from(member)); + } + return map; + } } diff --git a/core/src/main/java/org/bookwoori/core/domain/messageRoom/controller/MessageRoomController.java b/core/src/main/java/org/bookwoori/core/domain/messageRoom/controller/MessageRoomController.java index 2c94ee40..6809ab25 100644 --- a/core/src/main/java/org/bookwoori/core/domain/messageRoom/controller/MessageRoomController.java +++ b/core/src/main/java/org/bookwoori/core/domain/messageRoom/controller/MessageRoomController.java @@ -8,6 +8,7 @@ import org.bookwoori.core.domain.messageRoom.facade.MessageRoomFacade; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -36,4 +37,10 @@ public ResponseEntity getMyMessageRoomList(@RequestParam(defaultValue = "0") return ResponseEntity.ok(messageRoomFacade.getMyMessageRoomList(page, size)); } + //@Operation(summary = "DM 방 참여자 정보 조회", description = "DM 방에 참여하고 있는 회원들의 정보를 조회합니다.") + @GetMapping("/{messageRoomId}/members") + public ResponseEntity getParticipants(@PathVariable final Long messageRoomId) { + return ResponseEntity.ok(messageRoomFacade.getParticipants(messageRoomId)); + } + } diff --git a/core/src/main/java/org/bookwoori/core/domain/messageRoom/facade/MessageRoomFacade.java b/core/src/main/java/org/bookwoori/core/domain/messageRoom/facade/MessageRoomFacade.java index ac05b314..7b847f80 100644 --- a/core/src/main/java/org/bookwoori/core/domain/messageRoom/facade/MessageRoomFacade.java +++ b/core/src/main/java/org/bookwoori/core/domain/messageRoom/facade/MessageRoomFacade.java @@ -1,6 +1,7 @@ package org.bookwoori.core.domain.messageRoom.facade; import java.util.Comparator; +import java.util.HashMap; import java.util.List; import java.util.Map; import lombok.RequiredArgsConstructor; @@ -85,4 +86,18 @@ public MessageRoomListResponseDto getMyMessageRoomList(int page, int size) { return new MessageRoomListResponseDto(messageRoomItems); } + @Transactional(readOnly = true) + public Map getParticipants(Long messageRoomId) { + MessageRoom messageRoom = messageRoomService.getMessageRoomById(messageRoomId); + return createProfileMap(messageRoom.getSender(), messageRoom.getReceiver()); + } + + private Map createProfileMap(Member... members) { + Map map = new HashMap<>(); + for (Member member : members) { + map.put(member.getMemberId(), MemberProfileResponseDto.from(member)); + } + return map; + } + } diff --git a/core/src/main/java/org/bookwoori/core/domain/serverMember/repository/ServerMemberRepository.java b/core/src/main/java/org/bookwoori/core/domain/serverMember/repository/ServerMemberRepository.java index 303174ad..f5806723 100644 --- a/core/src/main/java/org/bookwoori/core/domain/serverMember/repository/ServerMemberRepository.java +++ b/core/src/main/java/org/bookwoori/core/domain/serverMember/repository/ServerMemberRepository.java @@ -25,6 +25,9 @@ public interface ServerMemberRepository extends JpaRepository findAllByServer(Server server); + @Query("SELECT sm.member FROM ServerMember sm WHERE sm.server = :server") + List findMembersByServer(Server server); + Optional findByMemberAndServer(Member member, Server server); diff --git a/core/src/main/java/org/bookwoori/core/domain/serverMember/service/ServerMemberService.java b/core/src/main/java/org/bookwoori/core/domain/serverMember/service/ServerMemberService.java index 32ca8d96..f34a5a3e 100644 --- a/core/src/main/java/org/bookwoori/core/domain/serverMember/service/ServerMemberService.java +++ b/core/src/main/java/org/bookwoori/core/domain/serverMember/service/ServerMemberService.java @@ -57,6 +57,11 @@ public List getAllMembersByServer(Server server) { .collect(Collectors.toList()); } + @Transactional(readOnly = true) + public List getMembersByServer(Server server) { + return serverMemberRepository.findMembersByServer(server); + } + @Transactional(readOnly = true) public List getServerListByMember(Member member) { return serverMemberRepository.findAllByMember(member).stream() diff --git a/core/src/main/java/org/bookwoori/core/global/feignClient/ChatClient.java b/core/src/main/java/org/bookwoori/core/global/feignClient/ChatClient.java index fc5cdb5b..a77ce134 100644 --- a/core/src/main/java/org/bookwoori/core/global/feignClient/ChatClient.java +++ b/core/src/main/java/org/bookwoori/core/global/feignClient/ChatClient.java @@ -7,10 +7,10 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; -@FeignClient(name = "core", url = "${client.url.chat}") +@FeignClient(name = "chat", url = "${client.url.chat}") public interface ChatClient { @GetMapping("/directMessages/recent") - public Map getRecentMessageFromMessageRoom( + Map getRecentMessageFromMessageRoom( @RequestParam("messageRoomIdList") List messageRoomIdList); } diff --git a/notification/src/main/java/org/bookwoori/notification/domain/dto/request/ChatMessageRequestDto.java b/notification/src/main/java/org/bookwoori/notification/domain/dto/request/ChatMessageRequestDto.java index 2d0df393..a2606424 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/dto/request/ChatMessageRequestDto.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/dto/request/ChatMessageRequestDto.java @@ -16,7 +16,6 @@ public record ChatMessageRequestDto( @NotNull String content, - @NotNull String channelName, @NotNull diff --git a/notification/src/main/java/org/bookwoori/notification/domain/dto/request/DirectMessageRequestDto.java b/notification/src/main/java/org/bookwoori/notification/domain/dto/request/DirectMessageRequestDto.java index e049d739..3d18a234 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/dto/request/DirectMessageRequestDto.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/dto/request/DirectMessageRequestDto.java @@ -16,7 +16,6 @@ public record DirectMessageRequestDto( @NotNull String content, - @NotNull String roomName, @NotNull diff --git a/notification/src/main/java/org/bookwoori/notification/domain/dto/response/DeviceResponseDto.java b/notification/src/main/java/org/bookwoori/notification/domain/dto/response/DeviceResponseDto.java index 06c7c049..1619e6ee 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/dto/response/DeviceResponseDto.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/dto/response/DeviceResponseDto.java @@ -4,7 +4,7 @@ import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; import lombok.Builder; -import org.bookwoori.notification.domain.Device; +import org.bookwoori.notification.domain.entity.Device; import org.bookwoori.notification.domain.type.Platform; diff --git a/notification/src/main/java/org/bookwoori/notification/domain/dto/response/DeviceTokenResponseDto.java b/notification/src/main/java/org/bookwoori/notification/domain/dto/response/DeviceTokenResponseDto.java index 21f6d221..d645d432 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/dto/response/DeviceTokenResponseDto.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/dto/response/DeviceTokenResponseDto.java @@ -4,7 +4,7 @@ import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; import lombok.Builder; -import org.bookwoori.notification.domain.Device; +import org.bookwoori.notification.domain.entity.Device; import org.bookwoori.notification.domain.type.Platform; diff --git a/notification/src/main/java/org/bookwoori/notification/domain/BaseTimeEntity.java b/notification/src/main/java/org/bookwoori/notification/domain/entity/BaseTimeEntity.java similarity index 91% rename from notification/src/main/java/org/bookwoori/notification/domain/BaseTimeEntity.java rename to notification/src/main/java/org/bookwoori/notification/domain/entity/BaseTimeEntity.java index ac29b92f..81eac4cf 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/BaseTimeEntity.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/entity/BaseTimeEntity.java @@ -1,4 +1,4 @@ -package org.bookwoori.notification.domain; +package org.bookwoori.notification.domain.entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.MappedSuperclass; diff --git a/notification/src/main/java/org/bookwoori/notification/domain/Device.java b/notification/src/main/java/org/bookwoori/notification/domain/entity/Device.java similarity index 95% rename from notification/src/main/java/org/bookwoori/notification/domain/Device.java rename to notification/src/main/java/org/bookwoori/notification/domain/entity/Device.java index 204f1dc3..f4723572 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/Device.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/entity/Device.java @@ -1,4 +1,4 @@ -package org.bookwoori.notification.domain; +package org.bookwoori.notification.domain.entity; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/notification/src/main/java/org/bookwoori/notification/domain/Notification.java b/notification/src/main/java/org/bookwoori/notification/domain/entity/Notification.java similarity index 95% rename from notification/src/main/java/org/bookwoori/notification/domain/Notification.java rename to notification/src/main/java/org/bookwoori/notification/domain/entity/Notification.java index eff801b7..228ba89e 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/Notification.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/entity/Notification.java @@ -1,4 +1,4 @@ -package org.bookwoori.notification.domain; +package org.bookwoori.notification.domain.entity; import lombok.*; import org.springframework.data.annotation.Id; diff --git a/notification/src/main/java/org/bookwoori/notification/domain/repository/DeviceRepository.java b/notification/src/main/java/org/bookwoori/notification/domain/repository/DeviceRepository.java index 5c8f5b19..b18c2bc1 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/repository/DeviceRepository.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/repository/DeviceRepository.java @@ -1,7 +1,7 @@ package org.bookwoori.notification.domain.repository; -import org.bookwoori.notification.domain.Device; +import org.bookwoori.notification.domain.entity.Device; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/notification/src/main/java/org/bookwoori/notification/domain/service/DeviceService.java b/notification/src/main/java/org/bookwoori/notification/domain/service/DeviceService.java index 89889036..1342ce39 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/service/DeviceService.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/service/DeviceService.java @@ -2,7 +2,7 @@ import lombok.RequiredArgsConstructor; -import org.bookwoori.notification.domain.Device; +import org.bookwoori.notification.domain.entity.Device; import org.bookwoori.notification.domain.dto.request.RegisterRequestDto; import org.bookwoori.notification.domain.dto.response.DeviceResponseDto; import org.bookwoori.notification.global.exception.CustomException; diff --git a/notification/src/main/java/org/bookwoori/notification/domain/service/NotificationService.java b/notification/src/main/java/org/bookwoori/notification/domain/service/NotificationService.java index b69b7226..d55ea760 100644 --- a/notification/src/main/java/org/bookwoori/notification/domain/service/NotificationService.java +++ b/notification/src/main/java/org/bookwoori/notification/domain/service/NotificationService.java @@ -7,8 +7,8 @@ import com.google.firebase.messaging.MulticastMessage; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.bookwoori.notification.domain.Device; -import org.bookwoori.notification.domain.Notification; +import org.bookwoori.notification.domain.entity.Device; +import org.bookwoori.notification.domain.entity.Notification; import org.bookwoori.notification.domain.dto.request.ChannelMessageRequestDto; import org.bookwoori.notification.domain.dto.request.ChatMessageRequestDto; import org.bookwoori.notification.domain.dto.request.DirectMessageRequestDto;