diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeReview.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeReview.java new file mode 100644 index 0000000..5862a04 --- /dev/null +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeReview.java @@ -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; + +} diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeStatus.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeStatus.java new file mode 100644 index 0000000..97fb2ae --- /dev/null +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeStatus.java @@ -0,0 +1,11 @@ +package org.haedal.zzansuni.domain.challengegroup.challenge; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public enum ChallengeStatus { + PROCEEDING("진행중"), + FINISHED("종료"); + + private final String korean; +} diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeVerification.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeVerification.java new file mode 100644 index 0000000..13cf27f --- /dev/null +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeVerification.java @@ -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; + + +} diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeVerificationStatus.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeVerificationStatus.java new file mode 100644 index 0000000..bb66562 --- /dev/null +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeVerificationStatus.java @@ -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; +} diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/UserChallenge.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/UserChallenge.java index de369d6..6544395 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/UserChallenge.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/UserChallenge.java @@ -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; }