From 41c7405b7eb99667bca6c2ff56416f83ae144c5b Mon Sep 17 00:00:00 2001 From: kimchaeeun3447 Date: Sat, 3 Jun 2023 19:32:43 +0900 Subject: [PATCH] =?UTF-8?q?[ADD]=20Mument,=20MumentTag=20Entity=20?= =?UTF-8?q?=EB=B0=8F=20Controller,=20Service=20=EC=9D=B8=ED=84=B0=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=EC=99=80=20=EA=B5=AC=ED=98=84=EB=B6=80=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20#4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mument/controller/MumentController.java | 14 +++++++ .../mument/core/mument/domain/Mument.java | 42 +++++++++++++++++++ .../mument/core/mument/domain/MumentTag.java | 28 +++++++++++++ .../mument/mument/core/mument/domain/Tag.java | 19 +++++++++ .../core/mument/service/MumentService.java | 4 ++ .../mument/service/MumentServiceImpl.java | 13 ++++++ 6 files changed, 120 insertions(+) create mode 100644 mument/src/main/java/com/mument/mument/core/mument/controller/MumentController.java create mode 100644 mument/src/main/java/com/mument/mument/core/mument/domain/Mument.java create mode 100644 mument/src/main/java/com/mument/mument/core/mument/domain/MumentTag.java create mode 100644 mument/src/main/java/com/mument/mument/core/mument/domain/Tag.java create mode 100644 mument/src/main/java/com/mument/mument/core/mument/service/MumentService.java create mode 100644 mument/src/main/java/com/mument/mument/core/mument/service/MumentServiceImpl.java diff --git a/mument/src/main/java/com/mument/mument/core/mument/controller/MumentController.java b/mument/src/main/java/com/mument/mument/core/mument/controller/MumentController.java new file mode 100644 index 0000000..432e798 --- /dev/null +++ b/mument/src/main/java/com/mument/mument/core/mument/controller/MumentController.java @@ -0,0 +1,14 @@ +package com.mument.mument.core.mument.controller; + +import com.mument.mument.core.mument.service.MumentService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/mument") +@AllArgsConstructor +public class MumentController { + + private final MumentService mumentService; +} diff --git a/mument/src/main/java/com/mument/mument/core/mument/domain/Mument.java b/mument/src/main/java/com/mument/mument/core/mument/domain/Mument.java new file mode 100644 index 0000000..ed462a1 --- /dev/null +++ b/mument/src/main/java/com/mument/mument/core/mument/domain/Mument.java @@ -0,0 +1,42 @@ +package com.mument.mument.core.mument.domain; + +import com.mument.mument.core.common.domain.BaseDate; +import com.mument.mument.core.user.domain.User; +import com.mument.mument.core.music.domain.Music; +import lombok.Getter; + +import javax.persistence.*; +import java.time.LocalDateTime; + +@Entity +@Getter +public class Mument extends BaseDate { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id", nullable = false) + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "music_id", nullable = false) + private Music music; + + @Column(length = 1000) + private String content; + + @Column(nullable = false, name = "is_first") + private boolean is_first; + + @Column(nullable = false) + private int likeCount; + + @Column(nullable = false, name = "is_deleted") + private boolean is_deleted; + + @Column(nullable = false, name = "is_private") + private boolean is_private; + + private LocalDateTime updatedAt; +} diff --git a/mument/src/main/java/com/mument/mument/core/mument/domain/MumentTag.java b/mument/src/main/java/com/mument/mument/core/mument/domain/MumentTag.java new file mode 100644 index 0000000..95cb933 --- /dev/null +++ b/mument/src/main/java/com/mument/mument/core/mument/domain/MumentTag.java @@ -0,0 +1,28 @@ +package com.mument.mument.core.mument.domain; + +import com.mument.mument.core.common.domain.BaseDate; +import lombok.Getter; + +import javax.persistence.*; +import java.time.LocalDateTime; + +@Entity +@Getter +public class MumentTag extends BaseDate { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "mument_id", nullable = false) + private Mument mument; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "tag_id", nullable = false) + private Tag tag; + + @Column(nullable = false, name = "is_deleted") + private boolean is_deleted; + + private LocalDateTime updatedAt; +} diff --git a/mument/src/main/java/com/mument/mument/core/mument/domain/Tag.java b/mument/src/main/java/com/mument/mument/core/mument/domain/Tag.java new file mode 100644 index 0000000..d652772 --- /dev/null +++ b/mument/src/main/java/com/mument/mument/core/mument/domain/Tag.java @@ -0,0 +1,19 @@ +package com.mument.mument.core.mument.domain; + +import lombok.Getter; + +import javax.persistence.*; + +@Entity +@Getter +public class Tag { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(nullable = false) + private int tagSort; + + @Column(length = 20) + private String content; +} diff --git a/mument/src/main/java/com/mument/mument/core/mument/service/MumentService.java b/mument/src/main/java/com/mument/mument/core/mument/service/MumentService.java new file mode 100644 index 0000000..574ccd3 --- /dev/null +++ b/mument/src/main/java/com/mument/mument/core/mument/service/MumentService.java @@ -0,0 +1,4 @@ +package com.mument.mument.core.mument.service; + +public interface MumentService { +} diff --git a/mument/src/main/java/com/mument/mument/core/mument/service/MumentServiceImpl.java b/mument/src/main/java/com/mument/mument/core/mument/service/MumentServiceImpl.java new file mode 100644 index 0000000..bf2bd42 --- /dev/null +++ b/mument/src/main/java/com/mument/mument/core/mument/service/MumentServiceImpl.java @@ -0,0 +1,13 @@ +package com.mument.mument.core.mument.service; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Transactional +@RequiredArgsConstructor +@Slf4j +@Service +public class MumentServiceImpl implements MumentService { +}