-
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
#3 [feat] : 도메인엔티티모델생성
- Loading branch information
Showing
12 changed files
with
162 additions
and
28 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 |
---|---|---|
|
@@ -36,6 +36,6 @@ out/ | |
### VS Code ### | ||
.vscode/ | ||
|
||
|
||
### application.yml ### | ||
application.yaml | ||
application.yaml | ||
application.yml |
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
22 changes: 22 additions & 0 deletions
22
was/src/main/java/qdang/group/was/global/util/AuditingTimeEntity.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 qdang.group.was.global.util; | ||
|
||
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 | ||
@MappedSuperclass | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class AuditingTimeEntity { | ||
|
||
@CreatedDate | ||
private LocalDateTime createdAt; | ||
|
||
@LastModifiedDate | ||
private LocalDateTime updatedAt; | ||
} |
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 |
---|---|---|
@@ -1,15 +1,49 @@ | ||
package qdang.group.was.match.domain; | ||
|
||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
import qdang.group.was.matchProcess.domain.MatchProcess; | ||
import qdang.group.was.userMatch.domain.UserMatch; | ||
|
||
import java.time.Duration; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Entity | ||
public class Match { | ||
@Entity(name = "q_match") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Match extends AuditingEntityListener { | ||
|
||
@Id | ||
@Column(name = "q_match_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
} | ||
@OneToMany(mappedBy = "match") | ||
private List<UserMatch> userMatchList; | ||
|
||
@Column(name = "user_count") | ||
private int userCount; | ||
|
||
private int matchTypeCode; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private MatchType matchTypeName; | ||
|
||
private LocalDateTime endAt; | ||
|
||
private Duration duration; | ||
|
||
private boolean deletedTf; | ||
|
||
private boolean validTf; | ||
|
||
@OneToMany(mappedBy = "match") | ||
private List<UserMatch> userMatcheList; | ||
|
||
@OneToMany(mappedBy = "match") | ||
private List<MatchProcess> matchProcessList; | ||
} |
19 changes: 19 additions & 0 deletions
19
was/src/main/java/qdang/group/was/match/domain/MatchType.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 qdang.group.was.match.domain; | ||
|
||
import jakarta.persistence.Embeddable; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public enum MatchType { | ||
|
||
pool(0, "pool"), | ||
BALL4(1, "ball4"), | ||
BALL3(2, "ball3"); | ||
|
||
private final int matchTypeCode; | ||
private final String matchTypeName; | ||
|
||
} |
25 changes: 22 additions & 3 deletions
25
was/src/main/java/qdang/group/was/matchProcess/domain/MatchProcess.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 |
---|---|---|
@@ -1,13 +1,32 @@ | ||
package qdang.group.was.matchProcess.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import qdang.group.was.match.domain.Match; | ||
import qdang.group.was.user.domain.User; | ||
|
||
@Getter | ||
@Entity | ||
@Entity(name = "q_match_process") | ||
public class MatchProcess { | ||
|
||
@Id | ||
@Column(name = "q_match_process_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "q_match_id") | ||
private Match match; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "q_user_id") | ||
private User user; | ||
|
||
private int processCount; | ||
|
||
private int turnCount; | ||
|
||
private int phaseCount; | ||
|
||
private boolean validTf; | ||
} |
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
4 changes: 0 additions & 4 deletions
4
was/src/main/java/qdang/group/was/user/controller/UserController.java
This file was deleted.
Oops, something went wrong.
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
33 changes: 29 additions & 4 deletions
33
was/src/main/java/qdang/group/was/userMatch/domain/UserMatch.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 |
---|---|---|
@@ -1,14 +1,39 @@ | ||
package qdang.group.was.userMatch.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import qdang.group.was.global.util.AuditingTimeEntity; | ||
import qdang.group.was.match.domain.Match; | ||
import qdang.group.was.user.domain.User; | ||
|
||
@Getter | ||
@Entity | ||
public class UserMatch { | ||
@Entity(name = "q_user_match") | ||
public class UserMatch extends AuditingTimeEntity { | ||
|
||
@Id | ||
@Column(name = "q_user_match_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "q_user_id") | ||
private User user; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "q_match_id") | ||
private Match match; | ||
|
||
private int targetScore; | ||
private int finishCushionTargetScore; | ||
private int finishBankShotTargetScore; | ||
private boolean validTf; | ||
private int score; | ||
private int finishCushionScore; | ||
private int finishBankShotScore; | ||
private int ranking; | ||
private int maxHighRun; | ||
private int average; | ||
private int inningCount; | ||
private int succeedInningCount; | ||
private int failedInningCount; | ||
} |
7 changes: 4 additions & 3 deletions
7
was/src/main/java/qdang/group/was/userMatchProcess/domain/UserMatchProcess.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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package qdang.group.was.userMatchProcess.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Entity | ||
@Entity(name = "q_user_match_process") | ||
public class UserMatchProcess { | ||
|
||
@Id | ||
@Column(name = "q_user_match_proccess_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
} |
This file was deleted.
Oops, something went wrong.