-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] Mument, MumentTag Entity 및 Controller, Service 인터페이스와 구현부 추가 #4
- Loading branch information
1 parent
1a8089c
commit 41c7405
Showing
6 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
mument/src/main/java/com/mument/mument/core/mument/controller/MumentController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
} |
42 changes: 42 additions & 0 deletions
42
mument/src/main/java/com/mument/mument/core/mument/domain/Mument.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
} |
28 changes: 28 additions & 0 deletions
28
mument/src/main/java/com/mument/mument/core/mument/domain/MumentTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
} |
19 changes: 19 additions & 0 deletions
19
mument/src/main/java/com/mument/mument/core/mument/domain/Tag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
} |
4 changes: 4 additions & 0 deletions
4
mument/src/main/java/com/mument/mument/core/mument/service/MumentService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.mument.mument.core.mument.service; | ||
|
||
public interface MumentService { | ||
} |
13 changes: 13 additions & 0 deletions
13
mument/src/main/java/com/mument/mument/core/mument/service/MumentServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 { | ||
} |