-
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.
[Feat]: ChallengeVerification, ChallengeReview도메인 제작
- Loading branch information
Showing
5 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...pp/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeReview.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,40 @@ | ||
package org.haedal.zzansuni.domain.challengegroup.challenge; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
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 lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.haedal.zzansuni.domain.BaseTimeEntity; | ||
import org.haedal.zzansuni.domain.challengegroup.ChallengeGroup; | ||
import org.haedal.zzansuni.domain.challengegroup.DayType; | ||
|
||
@Entity | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Getter | ||
@Builder | ||
public class ChallengeReview extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "user_challenge_id") | ||
private UserChallenge userChallenge; | ||
|
||
private String content; | ||
|
||
private Integer rating; | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
...pp/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeStatus.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,11 @@ | ||
package org.haedal.zzansuni.domain.challengegroup.challenge; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public enum ChallengeStatus { | ||
PROCEEDING("진행중"), | ||
FINISHED("종료"); | ||
|
||
private final String korean; | ||
} |
44 changes: 44 additions & 0 deletions
44
.../main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeVerification.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 org.haedal.zzansuni.domain.challengegroup.challenge; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
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 lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.haedal.zzansuni.domain.BaseTimeEntity; | ||
import org.haedal.zzansuni.domain.challengegroup.ChallengeGroup; | ||
import org.haedal.zzansuni.domain.challengegroup.DayType; | ||
|
||
@Entity | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Getter | ||
@Builder | ||
public class ChallengeVerification extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "user_challenge_id") | ||
private UserChallenge userChallenge; | ||
|
||
private String imageUrl; | ||
|
||
private String content; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private ChallengeVerificationStatus status; | ||
|
||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeVerificationStatus.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 org.haedal.zzansuni.domain.challengegroup.challenge; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public enum ChallengeVerificationStatus { | ||
WAITING("대기중"), | ||
APPROVED("승인"), | ||
REJECTED("거절"); | ||
|
||
private final String korean; | ||
} |
40 changes: 39 additions & 1 deletion
40
.../app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/UserChallenge.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,5 +1,43 @@ | ||
package org.haedal.zzansuni.domain.challengegroup.challenge; | ||
|
||
public class UserChallenge { | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
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 lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.haedal.zzansuni.domain.BaseTimeEntity; | ||
import org.haedal.zzansuni.domain.challengegroup.ChallengeGroup; | ||
import org.haedal.zzansuni.domain.challengegroup.DayType; | ||
import org.haedal.zzansuni.domain.user.User; | ||
|
||
@Entity | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Getter | ||
@Builder | ||
public class UserChallenge extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "challenge_id") | ||
private Challenge challenge; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "user_id") | ||
private User user; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private ChallengeStatus status; | ||
} |