-
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.
Browse files
Browse the repository at this point in the history
Create default entities - ckyeon
- Loading branch information
Showing
30 changed files
with
445 additions
and
64 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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/sequence/anonymous/common/BaseEntity.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.sequence.anonymous.common; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.EntityListeners; | ||
import jakarta.persistence.MappedSuperclass; | ||
import lombok.Getter; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@EntityListeners(AuditingEntityListener.class) | ||
@MappedSuperclass | ||
public class BaseEntity { | ||
|
||
@CreatedDate | ||
@Column(updatable = false) | ||
private LocalDateTime createdAt; | ||
|
||
@LastModifiedDate | ||
private LocalDateTime updatedAt; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/sequence/anonymous/matchpost/application/ChatService.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.sequence.anonymous.matchpost.application; | ||
|
||
import com.sequence.anonymous.matchpost.domain.repository.ChatRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@RequiredArgsConstructor | ||
@Service | ||
public class ChatService { | ||
|
||
private final ChatRepository chatRepository; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/sequence/anonymous/matchpost/application/MatchPostService.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.sequence.anonymous.matchpost.application; | ||
|
||
import com.sequence.anonymous.matchpost.domain.repository.MatchPostRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@RequiredArgsConstructor | ||
@Service | ||
public class MatchPostService { | ||
|
||
private final MatchPostRepository matchPostRepository; | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/sequence/anonymous/matchpost/domain/Chat.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.sequence.anonymous.matchpost.domain; | ||
|
||
import com.google.common.base.Preconditions; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import lombok.Getter; | ||
|
||
import java.util.UUID; | ||
|
||
@Getter | ||
@Entity | ||
public class Chat { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private UUID identifier; | ||
|
||
protected Chat() { | ||
} | ||
|
||
public Chat(UUID identifier) { | ||
this(null, identifier); | ||
} | ||
|
||
private Chat(Long id, UUID identifier) { | ||
Preconditions.checkArgument(identifier != null, "identifier must be provided."); | ||
|
||
this.id = id; | ||
this.identifier = identifier; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/com/sequence/anonymous/matchpost/domain/MatchPost.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,56 @@ | ||
package com.sequence.anonymous.matchpost.domain; | ||
|
||
import com.google.common.base.Preconditions; | ||
import com.sequence.anonymous.common.BaseEntity; | ||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Entity | ||
public class MatchPost extends BaseEntity { | ||
|
||
@NotNull | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(length = 50) | ||
@NotNull | ||
private String title; | ||
|
||
@Column(length = 50) | ||
@NotNull | ||
private String introduce; | ||
|
||
@Column(length = 50) | ||
@NotNull | ||
private String appeal; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(length = 10) | ||
@NotNull | ||
private Status status; | ||
|
||
protected MatchPost() { | ||
} | ||
|
||
public MatchPost(String title, String introduce, String appeal) { | ||
this(null, title, introduce, appeal, Status.RECRUIT); | ||
} | ||
|
||
private MatchPost(Long id, String title, String introduce, String appeal, Status status) { | ||
Preconditions.checkArgument(title != null, "title must be provided."); | ||
Preconditions.checkArgument(introduce != null, "introduce must be provided."); | ||
Preconditions.checkArgument(appeal != null, "appeal must be provided."); | ||
Preconditions.checkArgument(status != null, "status must be provided."); | ||
|
||
Preconditions.checkArgument(title.isEmpty(), "title must not be empty."); | ||
|
||
this.id = id; | ||
this.title = title; | ||
this.introduce = introduce; | ||
this.appeal = appeal; | ||
this.status = status; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/sequence/anonymous/matchpost/domain/Status.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,6 @@ | ||
package com.sequence.anonymous.matchpost.domain; | ||
|
||
public enum Status { | ||
RECRUIT, | ||
DONE | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/sequence/anonymous/matchpost/domain/repository/ChatRepository.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,9 @@ | ||
package com.sequence.anonymous.matchpost.domain.repository; | ||
|
||
import com.sequence.anonymous.matchpost.domain.Chat; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface ChatRepository extends JpaRepository<Chat, Long> { | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/sequence/anonymous/matchpost/domain/repository/MatchPostRepository.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,9 @@ | ||
package com.sequence.anonymous.matchpost.domain.repository; | ||
|
||
import com.sequence.anonymous.matchpost.domain.MatchPost; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface MatchPostRepository extends JpaRepository<MatchPost, Long> { | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/sequence/anonymous/matchpost/presentation/ChatController.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.sequence.anonymous.matchpost.presentation; | ||
|
||
import com.sequence.anonymous.matchpost.application.ChatService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RequiredArgsConstructor | ||
@RestController | ||
@RequestMapping("/chats") | ||
public class ChatController { | ||
|
||
private final ChatService chatService; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/sequence/anonymous/matchpost/presentation/MatchPostController.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.sequence.anonymous.matchpost.presentation; | ||
|
||
import com.sequence.anonymous.matchpost.application.MatchPostService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RequiredArgsConstructor | ||
@RestController | ||
@RequestMapping("/match-posts") | ||
public class MatchPostController { | ||
|
||
private final MatchPostService matchPostService; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/com/sequence/anonymous/security/CustomOAuth2User.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
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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/sequence/anonymous/security/CustomOidcUser.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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/sequence/anonymous/user/application/TagService.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.sequence.anonymous.user.application; | ||
|
||
import com.sequence.anonymous.user.domain.repository.TagRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@RequiredArgsConstructor | ||
@Service | ||
public class TagService { | ||
|
||
private final TagRepository tagRepository; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/sequence/anonymous/user/application/UserService.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.sequence.anonymous.user.application; | ||
|
||
import com.sequence.anonymous.user.domain.repository.UserRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@RequiredArgsConstructor | ||
@Service | ||
public class UserService { | ||
|
||
private final UserRepository userRepository; | ||
} |
54 changes: 0 additions & 54 deletions
54
src/main/java/com/sequence/anonymous/user/domain/User.java
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
src/main/java/com/sequence/anonymous/user/domain/repository/TagRepository.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.sequence.anonymous.user.domain.repository; | ||
|
||
import com.sequence.anonymous.user.domain.tag.Tag; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface TagRepository extends JpaRepository<Tag, Long> { | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/com/sequence/anonymous/user/domain/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
21 changes: 21 additions & 0 deletions
21
src/main/java/com/sequence/anonymous/user/domain/tag/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,21 @@ | ||
package com.sequence.anonymous.user.domain.tag; | ||
|
||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Entity | ||
public class Tag { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(unique = true, insertable = false, updatable = false, length = 10) | ||
@NotNull | ||
private String name; | ||
|
||
protected Tag() { | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/sequence/anonymous/user/domain/user/Gender.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,6 @@ | ||
package com.sequence.anonymous.user.domain.user; | ||
|
||
public enum Gender { | ||
FEMALE, | ||
MALE | ||
} |
2 changes: 1 addition & 1 deletion
2
...anonymous/user/domain/OAuth2Provider.java → ...mous/user/domain/user/OAuth2Provider.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
2 changes: 1 addition & 1 deletion
2
.../sequence/anonymous/user/domain/Role.java → ...ence/anonymous/user/domain/user/Role.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
Oops, something went wrong.