diff --git a/src/main/java/com/leets/team2/xclone/domain/chattingRoom/controller/ChattingRoomController.java b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/controller/ChattingRoomController.java new file mode 100644 index 0000000..defad14 --- /dev/null +++ b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/controller/ChattingRoomController.java @@ -0,0 +1,4 @@ +package com.leets.team2.xclone.domain.chattingRoom.controller; + +public class ChattingRoomController { +} diff --git a/src/main/java/com/leets/team2/xclone/domain/chattingRoom/dto/ChattingRoomDTO.java b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/dto/ChattingRoomDTO.java new file mode 100644 index 0000000..53564b5 --- /dev/null +++ b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/dto/ChattingRoomDTO.java @@ -0,0 +1,20 @@ +package com.leets.team2.xclone.domain.chattingRoom.dto; + +import jakarta.validation.constraints.NotNull; +import lombok.Builder; + +public class ChattingRoomDTO { + + @Builder + public record Save( + @NotNull(message = "chatMemberTag는 필수 값입니다.") + String chatMemberTag + ){} + + @Builder + public record Response( + Long id, + String participantNickname, + String participantTag + ){} +} diff --git a/src/main/java/com/leets/team2/xclone/domain/chattingRoom/entity/ChattingRoom.java b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/entity/ChattingRoom.java new file mode 100644 index 0000000..f0d45ee --- /dev/null +++ b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/entity/ChattingRoom.java @@ -0,0 +1,23 @@ +package com.leets.team2.xclone.domain.chattingRoom.entity; + +import com.leets.team2.xclone.common.entity.AbstractEntity; +import com.leets.team2.xclone.domain.member.entities.Member; +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Table(name = "chatting_room") +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Getter +public class ChattingRoom extends AbstractEntity { + @ManyToOne + @JoinColumn(name = "member1_id") + private Member member1; + + + @ManyToOne + @JoinColumn(name = "member2_id") + private Member member2; +} diff --git a/src/main/java/com/leets/team2/xclone/domain/chattingRoom/repository/ChattingRoomRepository.java b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/repository/ChattingRoomRepository.java new file mode 100644 index 0000000..8b5410c --- /dev/null +++ b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/repository/ChattingRoomRepository.java @@ -0,0 +1,9 @@ +package com.leets.team2.xclone.domain.chattingRoom.repository; + +import com.leets.team2.xclone.domain.member.entities.Member; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface ChattingRoomRepository extends JpaRepository { +} diff --git a/src/main/java/com/leets/team2/xclone/domain/chattingRoom/service/ChattingRoomService.java b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/service/ChattingRoomService.java new file mode 100644 index 0000000..b24a57a --- /dev/null +++ b/src/main/java/com/leets/team2/xclone/domain/chattingRoom/service/ChattingRoomService.java @@ -0,0 +1,11 @@ +package com.leets.team2.xclone.domain.chattingRoom.service; + +import com.leets.team2.xclone.domain.chattingRoom.repository.ChattingRoomRepository; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class ChattingRoomService { + private final ChattingRoomRepository chattingRoomRepository; +}