-
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.
Showing
23 changed files
with
389 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -35,3 +35,6 @@ out/ | |
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Q Class ### | ||
/src/main/generated/ |
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
19 changes: 19 additions & 0 deletions
19
mument/src/main/java/com/mument/mument/config/QuerydslConfig.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.config; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import javax.persistence.EntityManager; | ||
import javax.persistence.PersistenceContext; | ||
|
||
@Configuration | ||
public class QuerydslConfig { | ||
@PersistenceContext | ||
private EntityManager entityManager; | ||
|
||
@Bean | ||
public JPAQueryFactory jpaQueryFactory() { | ||
return new JPAQueryFactory(entityManager); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
mument/src/main/java/com/mument/mument/core/common/domain/BaseDate.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,24 @@ | ||
package com.mument.mument.core.common.domain; | ||
|
||
import lombok.Getter; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.EntityListeners; | ||
import javax.persistence.MappedSuperclass; | ||
import java.time.LocalDateTime; | ||
|
||
@EntityListeners(value = {AuditingEntityListener.class}) | ||
@MappedSuperclass | ||
@Getter | ||
public abstract class BaseDate { | ||
|
||
@CreatedDate | ||
@Column(updatable = false) | ||
private LocalDateTime createdAt; | ||
|
||
// @LastModifiedDate | ||
// private LocalDateTime updatedAt; | ||
} |
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; | ||
} |
24 changes: 24 additions & 0 deletions
24
mument/src/main/java/com/mument/mument/core/mument/domain/Like.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,24 @@ | ||
package com.mument.mument.core.mument.domain; | ||
|
||
import com.mument.mument.core.common.domain.BaseDate; | ||
import com.mument.mument.core.mument.domain.Mument; | ||
import com.mument.mument.core.user.domain.User; | ||
import lombok.Getter; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@Getter | ||
public class Like 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 = "mument_id", nullable = false) | ||
private Mument mument; | ||
} |
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; | ||
} |
7 changes: 7 additions & 0 deletions
7
mument/src/main/java/com/mument/mument/core/mument/repository/MumentRepository.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,7 @@ | ||
package com.mument.mument.core.mument.repository; | ||
|
||
import com.mument.mument.core.mument.domain.Mument; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface MumentRepository extends JpaRepository<Mument, Long>, MumentRepositoryCustom { | ||
} |
4 changes: 4 additions & 0 deletions
4
mument/src/main/java/com/mument/mument/core/mument/repository/MumentRepositoryCustom.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.repository; | ||
|
||
public interface MumentRepositoryCustom { | ||
} |
12 changes: 12 additions & 0 deletions
12
mument/src/main/java/com/mument/mument/core/mument/repository/MumentRepositoryImpl.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,12 @@ | ||
package com.mument.mument.core.mument.repository; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class MumentRepositoryImpl implements MumentRepositoryCustom { | ||
|
||
private final JPAQueryFactory queryFactory; | ||
} |
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 { | ||
} |
22 changes: 22 additions & 0 deletions
22
mument/src/main/java/com/mument/mument/core/music/domain/Music.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,22 @@ | ||
package com.mument.mument.core.music.domain; | ||
|
||
import lombok.Getter; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@Getter | ||
public class Music { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(nullable = false) | ||
private String artist; | ||
|
||
@Column(nullable = false) | ||
private String image; | ||
|
||
@Column(nullable = false) | ||
private String name; | ||
} |
14 changes: 14 additions & 0 deletions
14
mument/src/main/java/com/mument/mument/core/user/controller/UserController.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.user.controller; | ||
|
||
import com.mument.mument.core.user.service.UserService; | ||
import lombok.AllArgsConstructor; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/user") | ||
@AllArgsConstructor | ||
public class UserController { | ||
|
||
private final UserService userService; | ||
} |
23 changes: 23 additions & 0 deletions
23
mument/src/main/java/com/mument/mument/core/user/domain/Block.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,23 @@ | ||
package com.mument.mument.core.user.domain; | ||
|
||
import com.mument.mument.core.common.domain.BaseDate; | ||
import com.mument.mument.core.user.domain.User; | ||
import lombok.Getter; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@Getter | ||
public class Block 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 = "blocked_user_id", nullable = false) | ||
private User blockedUser; | ||
} |
44 changes: 44 additions & 0 deletions
44
mument/src/main/java/com/mument/mument/core/user/domain/User.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,44 @@ | ||
package com.mument.mument.core.user.domain; | ||
|
||
import com.mument.mument.core.common.domain.BaseDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.persistence.*; | ||
import java.time.LocalDateTime; | ||
|
||
@Entity | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class User extends BaseDate { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(length = 10) | ||
private String provider; | ||
|
||
@Column(length = 50) | ||
private String profileId; | ||
|
||
private String refreshToken; | ||
|
||
private String image; | ||
|
||
private LocalDateTime updatedAt; | ||
|
||
private String authenticationCode; | ||
|
||
private String gender; | ||
|
||
private String ageRange; | ||
|
||
private String email; | ||
|
||
@Column(nullable = false, name = "is_deleted") | ||
private boolean is_deleted; | ||
|
||
private String fcmToken; | ||
} |
7 changes: 7 additions & 0 deletions
7
mument/src/main/java/com/mument/mument/core/user/repository/UserRepository.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,7 @@ | ||
package com.mument.mument.core.user.repository; | ||
|
||
import com.mument.mument.core.user.domain.User; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface UserRepository extends JpaRepository<User, Long>, UserRepositoryCustom { | ||
} |
5 changes: 5 additions & 0 deletions
5
mument/src/main/java/com/mument/mument/core/user/repository/UserRepositoryCustom.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,5 @@ | ||
package com.mument.mument.core.user.repository; | ||
|
||
// QueryDSL 로 custom 해서 사용할 메소드 선언 | ||
public interface UserRepositoryCustom { | ||
} |
Oops, something went wrong.