-
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.
Merge pull request #3 from KNU-HAEDAL/feat/entity
Feat/entity
- Loading branch information
Showing
17 changed files
with
422 additions
and
88 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
65 changes: 34 additions & 31 deletions
65
...p/src/main/java/org/haedal/zzansuni/controller/challengegroup/challenge/ChallengeRes.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,72 +1,75 @@ | ||
package org.haedal.zzansuni.controller.challengegroup.challenge; | ||
|
||
import lombok.Builder; | ||
import org.haedal.zzansuni.domain.challenge.ChallengeCategory; | ||
import org.haedal.zzansuni.domain.challengegroup.ChallengeCategory; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
public class ChallengeRes { | ||
|
||
@Builder | ||
public record ChallengeVerificationResponse( | ||
Integer totalCount, | ||
Integer successCount, | ||
Integer obtainExp | ||
Integer totalCount, | ||
Integer successCount, | ||
Integer obtainExp | ||
) { | ||
|
||
} | ||
|
||
@Builder | ||
public record ChallengeRecordResponse( | ||
String title, | ||
Integer totalCount, | ||
Integer successCount, | ||
LocalDate startDate, | ||
LocalDate endDate, | ||
List<Long> recordIds | ||
String title, | ||
Integer totalCount, | ||
Integer successCount, | ||
LocalDate startDate, | ||
LocalDate endDate, | ||
List<Long> recordIds | ||
) { | ||
|
||
} | ||
|
||
@Builder | ||
public record ChallengeRecordDetailDto( | ||
Long id, | ||
LocalDateTime createdAt, | ||
String content, | ||
String imageUrl | ||
Long id, | ||
LocalDateTime createdAt, | ||
String content, | ||
String imageUrl | ||
) { | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
|
||
@Builder | ||
public record ChallengeCurrentDto( | ||
Long id, | ||
String title, | ||
Integer successCount, | ||
Integer totalCount, | ||
Long id, | ||
String title, | ||
Integer successCount, | ||
Integer totalCount, | ||
|
||
LocalDate participationDate, | ||
LocalDate startDate, | ||
LocalDate endDate, | ||
LocalDate participationDate, | ||
LocalDate startDate, | ||
LocalDate endDate, | ||
|
||
ChallengeCategory category, | ||
Boolean reviewWritten | ||
ChallengeCategory category, | ||
Boolean reviewWritten | ||
|
||
) { | ||
|
||
} | ||
|
||
@Builder | ||
public record ChallengeCompleteDto( | ||
Long id, | ||
String title, | ||
Long id, | ||
String title, | ||
|
||
LocalDate successDate, | ||
LocalDate successDate, | ||
|
||
ChallengeCategory category, | ||
Boolean reviewWritten | ||
ChallengeCategory category, | ||
Boolean reviewWritten | ||
|
||
) { | ||
|
||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/BaseTimeEntity.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 org.haedal.zzansuni.domain; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.EntityListeners; | ||
import jakarta.persistence.MappedSuperclass; | ||
import java.time.LocalDateTime; | ||
import lombok.Getter; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
@Getter | ||
@MappedSuperclass | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class BaseTimeEntity { | ||
|
||
@CreatedDate | ||
@Column(name = "created_at") | ||
private LocalDateTime createdAt; | ||
|
||
@LastModifiedDate | ||
@Column(name = "last_modified_at") | ||
private LocalDateTime lastModifiedAt; | ||
} |
3 changes: 2 additions & 1 deletion
3
zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/auth/AuthService.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,4 +1,5 @@ | ||
package org.haedal.zzansuni.domain.auth; | ||
|
||
public class AuthService { | ||
} | ||
|
||
} |
5 changes: 0 additions & 5 deletions
5
...-api-server/app/src/main/java/org/haedal/zzansuni/domain/challenge/ChallengeCategory.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/ChallengeCategory.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,16 @@ | ||
package org.haedal.zzansuni.domain.challengegroup; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public enum ChallengeCategory { | ||
HEALTH("건강"), | ||
ECHO("에코"), | ||
|
||
SHARE("나눔"), | ||
|
||
VOLUNTEER("봉사"), | ||
ETC("기타"); | ||
|
||
private final String korean; | ||
} |
36 changes: 36 additions & 0 deletions
36
...pi-server/app/src/main/java/org/haedal/zzansuni/domain/challengegroup/ChallengeGroup.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,36 @@ | ||
package org.haedal.zzansuni.domain.challengegroup; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.haedal.zzansuni.domain.BaseTimeEntity; | ||
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
@Builder | ||
@Getter | ||
public class ChallengeGroup extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private ChallengeCategory category; | ||
|
||
private String title; | ||
|
||
private String content; | ||
|
||
private Integer cumulativeCount; | ||
|
||
} |
Oops, something went wrong.