-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[feat] #2 도메인 생성
- Loading branch information
Showing
26 changed files
with
582 additions
and
4 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
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
30 changes: 30 additions & 0 deletions
30
src/main/java/com/leets/xcellentbe/domain/chatroom/domain/Chatroom.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,30 @@ | ||
package com.leets.xcellentbe.domain.chatroom.domain; | ||
|
||
import java.util.UUID; | ||
|
||
import com.leets.xcellentbe.domain.shared.BaseTimeEntity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Chatroom extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.UUID) | ||
private UUID ChatroomId; | ||
|
||
@Column(length = 50) | ||
private String lastParticipantName; | ||
|
||
@Column | ||
private String lastMessage; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/leets/xcellentbe/domain/chatroom/domain/controller/ChatroomController.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.leets.xcellentbe.domain.chatroom.domain.controller; | ||
|
||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequestMapping("/chatroom") | ||
@RequiredArgsConstructor | ||
public class ChatroomController { | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/leets/xcellentbe/domain/chatroom/domain/repository/ChatroomRepository.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,10 @@ | ||
package com.leets.xcellentbe.domain.chatroom.domain.repository; | ||
|
||
import java.util.UUID; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.leets.xcellentbe.domain.chatroom.domain.Chatroom; | ||
|
||
public interface ChatroomRepository extends JpaRepository<Chatroom, UUID> { | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/com/leets/xcellentbe/domain/comment/domain/Comment.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,48 @@ | ||
package com.leets.xcellentbe.domain.comment.domain; | ||
|
||
import java.util.UUID; | ||
|
||
import com.leets.xcellentbe.domain.post.domain.Post; | ||
import com.leets.xcellentbe.domain.shared.BaseTimeEntity; | ||
import com.leets.xcellentbe.domain.shared.DeletedStatus; | ||
import com.leets.xcellentbe.domain.user.domain.User; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Comment extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.UUID) | ||
private UUID CommentId; | ||
|
||
@NotNull | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "writer_id") | ||
private User writer; | ||
|
||
@Column(length = 50) | ||
private String content; | ||
|
||
@NotNull | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "post_id") | ||
private Post post; | ||
|
||
@NotNull | ||
@Column | ||
private DeletedStatus deletedStatus; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/leets/xcellentbe/domain/comment/domain/repository/CommentRepository.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,10 @@ | ||
package com.leets.xcellentbe.domain.comment.domain.repository; | ||
|
||
import java.util.UUID; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.leets.xcellentbe.domain.comment.domain.Comment; | ||
|
||
public interface CommentRepository extends JpaRepository<Comment, UUID> { | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/com/leets/xcellentbe/domain/dm/domain/DM.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,49 @@ | ||
package com.leets.xcellentbe.domain.dm.domain; | ||
|
||
import java.util.UUID; | ||
|
||
import com.leets.xcellentbe.domain.chatroom.domain.Chatroom; | ||
import com.leets.xcellentbe.domain.shared.BaseTimeEntity; | ||
import com.leets.xcellentbe.domain.shared.DeletedStatus; | ||
import com.leets.xcellentbe.domain.user.domain.User; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class DM extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.UUID) | ||
private UUID DMId; | ||
|
||
@NotNull | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "chatroom_id") | ||
private Chatroom chatRoom; | ||
|
||
@NotNull | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "participant_id") | ||
private User participant; | ||
|
||
@NotNull | ||
@Column | ||
private String message; | ||
|
||
@NotNull | ||
@Column | ||
private DeletedStatus deletedStatus; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/leets/xcellentbe/domain/dm/domain/repository/DMRepository.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,10 @@ | ||
package com.leets.xcellentbe.domain.dm.domain.repository; | ||
|
||
import java.util.UUID; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.leets.xcellentbe.domain.dm.domain.DM; | ||
|
||
public interface DMRepository extends JpaRepository<DM, UUID> { | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/leets/xcellentbe/domain/follow/domain/Follow.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,35 @@ | ||
package com.leets.xcellentbe.domain.follow.domain; | ||
|
||
import com.leets.xcellentbe.domain.user.domain.User; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Follow { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long FollowId; | ||
|
||
@NotNull | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "following_id") | ||
private User following; | ||
|
||
@NotNull | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "follower_id") | ||
private User follower; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/leets/xcellentbe/domain/follow/domain/repository/FollowRepository.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,8 @@ | ||
package com.leets.xcellentbe.domain.follow.domain.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.leets.xcellentbe.domain.follow.domain.Follow; | ||
|
||
public interface FollowRepository extends JpaRepository<Follow, Long> { | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/leets/xcellentbe/domain/hashtag/domain/Hashtag.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.leets.xcellentbe.domain.hashtag.domain; | ||
|
||
import java.util.UUID; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Hashtag { | ||
|
||
@Id | ||
@Column(name = "hashtag_id") | ||
@GeneratedValue(strategy = GenerationType.UUID) | ||
private UUID HashtagId; | ||
|
||
@NotNull | ||
@Column(length = 30) | ||
private String content; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/leets/xcellentbe/domain/hashtag/domain/repository/HashtagRepository.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,8 @@ | ||
package com.leets.xcellentbe.domain.hashtag.domain.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.leets.xcellentbe.domain.hashtag.domain.Hashtag; | ||
|
||
public interface HashtagRepository extends JpaRepository<Hashtag, Long> { | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/leets/xcellentbe/domain/post/controller/PostController.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.leets.xcellentbe.domain.post.controller; | ||
|
||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequestMapping("/post") | ||
@RequiredArgsConstructor | ||
public class PostController { | ||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/com/leets/xcellentbe/domain/post/domain/Post.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,57 @@ | ||
package com.leets.xcellentbe.domain.post.domain; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
import com.leets.xcellentbe.domain.hashtag.domain.Hashtag; | ||
import com.leets.xcellentbe.domain.shared.DeletedStatus; | ||
import com.leets.xcellentbe.domain.user.domain.User; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.OneToMany; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Post { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.UUID) | ||
private UUID PostId; | ||
|
||
@NotNull | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "writer_id") | ||
private User writer; | ||
|
||
@NotNull | ||
@Column | ||
private String content; | ||
|
||
@NotNull | ||
@Column | ||
private DeletedStatus deletedStatus; | ||
|
||
@NotNull | ||
@Column | ||
private Boolean isPinned; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "repost_id") | ||
private Post rePost; | ||
|
||
@OneToMany(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "hashtag_id") | ||
private List<Hashtag> hashtags; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/leets/xcellentbe/domain/post/domain/repository/PostRepository.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,10 @@ | ||
package com.leets.xcellentbe.domain.post.domain.repository; | ||
|
||
import java.util.UUID; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.leets.xcellentbe.domain.post.domain.Post; | ||
|
||
public interface PostRepository extends JpaRepository<Post, UUID> { | ||
} |
Oops, something went wrong.