-
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 remote-tracking branch 'origin/feature-#15' into feature-#15
# Conflicts: # src/main/java/leets/weeth/domain/attendance/controller/AttendanceController.java # src/main/java/leets/weeth/domain/attendance/dto/ResponseAttendance.java # src/main/java/leets/weeth/domain/attendance/entity/Attendance.java # src/main/java/leets/weeth/domain/attendance/entity/AttendanceCode.java # src/main/java/leets/weeth/domain/attendance/repository/AttendanceRepository.java # src/main/java/leets/weeth/domain/attendance/service/AttendanceService.java # src/main/resources/application-local.yml
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/main/java/leets/weeth/domain/attendance/dto/ResponseAttendanceSummary.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,15 @@ | ||
package leets.weeth.domain.attendance.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
public class ResponseAttendanceSummary { | ||
private long totalEvents; // 총 모임 횟수 | ||
private long totalAttendances; // 출석 횟수 | ||
private long totalAbsences; // 결석 횟수 | ||
private List<ResponseAttendance> attendanceDetails; // 상세 출석 정보 리스트 | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/leets/weeth/domain/attendance/entity/enums/WeekEnum.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,26 @@ | ||
package leets.weeth.domain.attendance.entity.enums; | ||
|
||
import java.time.LocalDate; | ||
|
||
public enum WeekEnum { | ||
WEEK_1(LocalDate.of(2023, 1, 1), LocalDate.of(2023, 1, 7)), | ||
WEEK_2(LocalDate.of(2023, 1, 8), LocalDate.of(2023, 1, 14)), | ||
WEEK_3(LocalDate.of(2023, 1, 15), LocalDate.of(2023, 1, 17)), | ||
WEEK_4(LocalDate.of(2023, 1, 18), LocalDate.of(2023, 1, 19)); | ||
|
||
private final LocalDate startDate; | ||
private final LocalDate endDate; | ||
|
||
WeekEnum(LocalDate startDate, LocalDate endDate) { | ||
this.startDate = startDate; | ||
this.endDate = endDate; | ||
} | ||
|
||
public LocalDate getStartDate() { | ||
return startDate; | ||
} | ||
|
||
public LocalDate getEndDate() { | ||
return endDate; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/leets/weeth/domain/attendance/repository/AttendanceCodeRepository.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,13 @@ | ||
package leets.weeth.domain.attendance.repository; | ||
|
||
import leets.weeth.domain.attendance.entity.AttendanceCode; | ||
import leets.weeth.domain.attendance.entity.enums.WeekEnum; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.Optional; | ||
|
||
public interface AttendanceCodeRepository extends JpaRepository<AttendanceCode, Long> { | ||
Optional<AttendanceCode> findByWeekAndExpirationTimeAfter(WeekEnum weekEnum, LocalDateTime currentTime); | ||
} | ||
|