From 976776c1de339c66b08ba4de42fa08a5c29dca8c Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 05:51:28 +0900 Subject: [PATCH 01/30] =?UTF-8?q?feat:=20=EC=A0=95=EA=B8=B0=EB=AA=A8?= =?UTF-8?q?=EC=9E=84=20=EC=B6=9C=EC=84=9D=EC=83=81=ED=83=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EC=84=B1=EA=B3=B5=20=EC=9D=91=EB=8B=B5=20=EB=A9=94?= =?UTF-8?q?=EC=84=B8=EC=A7=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weeth/domain/attendance/presentation/ResponseMessage.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java b/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java index 2f3f9ffd..29560f1a 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java @@ -8,6 +8,7 @@ public enum ResponseMessage { //AttendanceAdminController 관련 ATTENDANCE_CLOSE_SUCCESS("출석이 성공적으로 마감되었습니다."), + ATTENDANCE_UPDATED_ALL_SUCCESS("정기모임의 모든 출석 상태가 성공적으로 수정되었습니다."), //AttendanceController 관련 ATTENDANCE_CHECKIN_SUCCESS("출석이 성공적으로 처리되었습니다."), From 6dfaf09565b2c7a40171b8bd6d180bdf30ba61ad Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 05:52:19 +0900 Subject: [PATCH 02/30] =?UTF-8?q?feat:=20updateMeetingStatus=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/usecase/AttendanceUseCaseImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java index 939a1cbd..1640a250 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java @@ -91,4 +91,13 @@ public void close(LocalDate now, Integer cardinal) { attendanceUpdateService.close(attendanceList); } + @Override + @Transactional + public void updateMeetingStatus(Long meetingId) { + Meeting meeting = meetingGetService.find(meetingId); + + List attendances = attendanceGetService.findAllByMeeting(meeting); + + attendanceUpdateService.updateUserAttendanceByStatus(attendances); + } } From a87f17c841d4a9a32b775cd83cfce6e3e3aea70d Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 05:53:05 +0900 Subject: [PATCH 03/30] =?UTF-8?q?feat:=20updateMeetingStatus=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EC=9C=A0=EC=8A=A4=EC=BC=80=EC=9D=B4?= =?UTF-8?q?=EC=8A=A4=EC=97=90=EC=84=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/application/usecase/AttendanceUseCase.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java index 6f61a801..a16edd4a 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java @@ -15,4 +15,6 @@ public interface AttendanceUseCase { Detail findAll(Long userId); void close(LocalDate now, Integer cardinal); + + void updateMeetingStatus(Long meetingId); } From b50d21ee5f239dea0a0be826ea464bffafe3c9d3 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 05:54:11 +0900 Subject: [PATCH 04/30] =?UTF-8?q?feat:=20=EC=A0=95=EA=B8=B0=EB=AA=A8?= =?UTF-8?q?=EC=9E=84=EC=9D=98=20=EB=AA=A8=EB=93=A0=20=EC=B6=9C=EC=84=9D?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EB=B3=80=EA=B2=BD=20=EC=BB=A8=ED=8A=B8?= =?UTF-8?q?=EB=A1=A4=EB=9F=AC=20=EA=B5=AC=ED=98=84=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/AttendanceAdminController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java index 5f8aab92..f29fd36b 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java @@ -1,6 +1,7 @@ package leets.weeth.domain.attendance.presentation; import static leets.weeth.domain.attendance.presentation.ResponseMessage.ATTENDANCE_CLOSE_SUCCESS; +import static leets.weeth.domain.attendance.presentation.ResponseMessage.ATTENDANCE_UPDATED_ALL_SUCCESS; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -8,6 +9,7 @@ import leets.weeth.global.common.response.CommonResponse; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -28,4 +30,10 @@ public CommonResponse close(@RequestParam LocalDate now, @RequestParam Int attendanceUseCase.close(now, cardinal); return CommonResponse.createSuccess(ATTENDANCE_CLOSE_SUCCESS.getMessage()); } + @PatchMapping("/{meetingId}") + @Operation(summary = "정기모임 모든 출석 상태 수정") + public CommonResponse updateMeetingStatus(@PathVariable Long meetingId) { + attendanceUseCase.updateMeetingStatus(meetingId); + return CommonResponse.createSuccess(ATTENDANCE_UPDATED_ALL_SUCCESS.getMessage()); + } } From a51783344ed3a9f8fb39e7373f335705d5a2c588 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:14:20 +0900 Subject: [PATCH 05/30] =?UTF-8?q?feat=20:=20attendanceId=EB=A1=9C=20?= =?UTF-8?q?=EA=B0=9C=EB=B3=84=20=EC=B6=9C=EC=84=9D=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/AttendanceAdminController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java index f29fd36b..77c6b62d 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java @@ -1,7 +1,7 @@ package leets.weeth.domain.attendance.presentation; import static leets.weeth.domain.attendance.presentation.ResponseMessage.ATTENDANCE_CLOSE_SUCCESS; -import static leets.weeth.domain.attendance.presentation.ResponseMessage.ATTENDANCE_UPDATED_ALL_SUCCESS; +import static leets.weeth.domain.attendance.presentation.ResponseMessage.ATTENDANCE_UPDATED_SUCCESS; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -30,10 +30,11 @@ public CommonResponse close(@RequestParam LocalDate now, @RequestParam Int attendanceUseCase.close(now, cardinal); return CommonResponse.createSuccess(ATTENDANCE_CLOSE_SUCCESS.getMessage()); } - @PatchMapping("/{meetingId}") - @Operation(summary = "정기모임 모든 출석 상태 수정") - public CommonResponse updateMeetingStatus(@PathVariable Long meetingId) { - attendanceUseCase.updateMeetingStatus(meetingId); - return CommonResponse.createSuccess(ATTENDANCE_UPDATED_ALL_SUCCESS.getMessage()); + + @PatchMapping("/{attendanceId}") + @Operation(summary = "출석 상태 수정") + public CommonResponse updateAttendanceStatus(@PathVariable Long attendanceId) { + attendanceUseCase.updateAttendanceStatus(attendanceId); + return CommonResponse.createSuccess(ATTENDANCE_UPDATED_SUCCESS.getMessage()); } } From 687dae687e1d2e9448a3be90a8ce62ffdd55c8e6 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:15:00 +0900 Subject: [PATCH 06/30] =?UTF-8?q?feat=20:=20=EC=84=9C=EB=B9=84=EC=8A=A4?= =?UTF-8?q?=EB=8B=A8=EC=97=90=EC=84=9C=20findAttendanceId=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/domain/service/AttendanceGetService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceGetService.java b/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceGetService.java index 1164078a..5b45d947 100644 --- a/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceGetService.java +++ b/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceGetService.java @@ -1,5 +1,6 @@ package leets.weeth.domain.attendance.domain.service; +import leets.weeth.domain.attendance.application.exception.AttendanceNotFoundException; import leets.weeth.domain.attendance.domain.entity.Attendance; import leets.weeth.domain.attendance.domain.repository.AttendanceRepository; import leets.weeth.domain.schedule.domain.entity.Meeting; @@ -17,4 +18,8 @@ public class AttendanceGetService { public List findAllByMeeting(Meeting meeting) { return attendanceRepository.findAllByMeeting(meeting); } + public Attendance findAttendanceId(Long attendanceId) { + return attendanceRepository.findById(attendanceId) + .orElseThrow(AttendanceNotFoundException::new); + } } From 73fdbb92f734798fa5066800f8d271230630478a Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:16:17 +0900 Subject: [PATCH 07/30] =?UTF-8?q?feat=20:=20=EA=B8=B0=EC=A1=B4=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EC=9E=AC=ED=99=9C=EC=9A=A9=ED=95=B4?= =?UTF-8?q?=EC=84=9C=20=EC=B6=9C=EC=84=9D=20=EB=8B=A8=EC=9D=BC=20=EA=B0=9D?= =?UTF-8?q?=EC=B2=B4=EB=A5=BC=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=ED=99=98=ED=95=B4=EC=A3=BC=EB=8A=94=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/domain/service/AttendanceUpdateService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceUpdateService.java b/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceUpdateService.java index 50dad48d..13c7f5fd 100644 --- a/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceUpdateService.java +++ b/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceUpdateService.java @@ -38,4 +38,7 @@ public void updateUserAttendanceByStatus(List attendances) { } } } + public void updateUserAttendanceByStatus(Attendance attendance) { + updateUserAttendanceByStatus(List.of(attendance)); + } } From ee1bca24f32900ea3476364fbc9c6257d87b9ed6 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:17:17 +0900 Subject: [PATCH 08/30] =?UTF-8?q?feat=20:=20=EC=9C=A0=EC=8A=A4=EC=BC=80?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=EC=97=90=EC=84=9C=20updateAttendanceStatus?= =?UTF-8?q?=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/application/usecase/AttendanceUseCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java index a16edd4a..5752d525 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java @@ -16,5 +16,5 @@ public interface AttendanceUseCase { void close(LocalDate now, Integer cardinal); - void updateMeetingStatus(Long meetingId); + void updateAttendanceStatus(Long attendanceId); } From d1fe00996828507479807b2cebd1c64ddd98800c Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:18:40 +0900 Subject: [PATCH 09/30] =?UTF-8?q?feat=20:=20Attendance=20=EA=B0=9D?= =?UTF-8?q?=EC=B2=B4=20=EC=84=9C=EB=B9=84=EC=8A=A4=20=EB=8B=A8=EC=97=90=20?= =?UTF-8?q?=EC=A0=84=EB=8B=AC=ED=95=B4=EC=A3=BC=EB=8A=94=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/usecase/AttendanceUseCaseImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java index 1640a250..7d6429b6 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java @@ -93,11 +93,9 @@ public void close(LocalDate now, Integer cardinal) { } @Override @Transactional - public void updateMeetingStatus(Long meetingId) { - Meeting meeting = meetingGetService.find(meetingId); + public void updateAttendanceStatus(Long attendanceId) { + Attendance attendance = attendanceGetService.findAttendanceId(attendanceId); - List attendances = attendanceGetService.findAllByMeeting(meeting); - - attendanceUpdateService.updateUserAttendanceByStatus(attendances); + attendanceUpdateService.updateUserAttendanceByStatus(attendance); } } From e567c421e5517314928fbb770655f0bbff6b3bfc Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:19:05 +0900 Subject: [PATCH 10/30] =?UTF-8?q?feat=20:=20=EA=B0=9C=EB=B3=84=20=EC=B6=9C?= =?UTF-8?q?=EC=84=9D=EC=83=81=ED=83=9C=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=84=B1=EA=B3=B5=20=EB=A9=94=EC=84=B8=EC=A7=80=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weeth/domain/attendance/presentation/ResponseMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java b/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java index 29560f1a..506da56b 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java @@ -8,7 +8,7 @@ public enum ResponseMessage { //AttendanceAdminController 관련 ATTENDANCE_CLOSE_SUCCESS("출석이 성공적으로 마감되었습니다."), - ATTENDANCE_UPDATED_ALL_SUCCESS("정기모임의 모든 출석 상태가 성공적으로 수정되었습니다."), + ATTENDANCE_UPDATED_SUCCESS("개별 출석 상태가 성공적으로 수정되었습니다."), //AttendanceController 관련 ATTENDANCE_CHECKIN_SUCCESS("출석이 성공적으로 처리되었습니다."), From cfb9ded08b21ce77d0d8003f37f4ca0bf4d6dbef Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:22:03 +0900 Subject: [PATCH 11/30] =?UTF-8?q?feat=20:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=A0=20=EB=8B=A8=EC=9D=BC=20=EC=B6=9C=EC=84=9D=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20dto=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/attendance/application/dto/AttendanceDTO.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java b/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java index 1a2bcc8c..7e715af4 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java +++ b/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java @@ -36,4 +36,13 @@ public record Response( public record CheckIn( Integer code ) {} + public record AttendanceInfo( + Long id, + Status status, + Integer weekNumber, + String name, + String position, + String department, + String studentId + ) {} } From 44e8f35799516083d1ff83a30567d0a3dcfb9839 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:22:28 +0900 Subject: [PATCH 12/30] =?UTF-8?q?feat=20:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EC=B6=9C=EC=84=9D=20=EC=A0=95=EB=B3=B4=20=EB=B0=98=ED=99=98=20?= =?UTF-8?q?=EC=84=B1=EA=B3=B5=20=EB=A9=94=EC=84=B8=EC=A7=80=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weeth/domain/attendance/presentation/ResponseMessage.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java b/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java index 506da56b..c60638d0 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java @@ -9,6 +9,7 @@ public enum ResponseMessage { //AttendanceAdminController 관련 ATTENDANCE_CLOSE_SUCCESS("출석이 성공적으로 마감되었습니다."), ATTENDANCE_UPDATED_SUCCESS("개별 출석 상태가 성공적으로 수정되었습니다."), + ATTENDANCE_FIND_DETAIL_SUCCESS("사용자의 출석 정보가 성공적으로 조회되었습니다."), //AttendanceController 관련 ATTENDANCE_CHECKIN_SUCCESS("출석이 성공적으로 처리되었습니다."), From 6271eda4fa9db8b2d796867a9a0997d9be1f3c04 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:23:31 +0900 Subject: [PATCH 13/30] =?UTF-8?q?feat=20:=20attendanceId=EB=A1=9C=20?= =?UTF-8?q?=EC=B6=9C=EC=84=9D=20=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=ED=9B=84=20=20DTO=20=ED=98=95=ED=83=9C=EB=A1=9C=20=EB=B0=98?= =?UTF-8?q?=ED=99=98=20=ED=95=B4=EC=A3=BC=EA=B8=B0=20=EC=9C=84=ED=95=9C=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/application/usecase/AttendanceUseCase.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java index 5752d525..9918fc41 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java @@ -1,5 +1,6 @@ package leets.weeth.domain.attendance.application.usecase; +import leets.weeth.domain.attendance.application.dto.AttendanceDTO.AttendanceInfo; import leets.weeth.domain.attendance.application.exception.AttendanceCodeMismatchException; import java.time.LocalDate; @@ -14,6 +15,8 @@ public interface AttendanceUseCase { Detail findAll(Long userId); + AttendanceInfo findAttendance(Long attendanceId); + void close(LocalDate now, Integer cardinal); void updateAttendanceStatus(Long attendanceId); From 37b961517067e5bd0044336cf94d5335cd930cff Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:24:45 +0900 Subject: [PATCH 14/30] =?UTF-8?q?feat=20:=20Attendance=20=EA=B0=9D?= =?UTF-8?q?=EC=B2=B4=EB=A5=BC=20=EB=A7=A4=ED=8D=BC=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=B4=EC=84=9C=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/usecase/AttendanceUseCaseImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java index 7d6429b6..e01df371 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java @@ -73,7 +73,13 @@ public AttendanceDTO.Detail findAll(Long userId) { return mapper.toDetailDto(user, responses); } + @Override + public AttendanceDTO.AttendanceInfo findAttendance(Long attendanceId) { + + Attendance attendance = attendanceGetService.findAttendanceId(attendanceId); + return mapper.toAttendanceInfoDto(attendance); + } @Override public void close(LocalDate now, Integer cardinal) { List meetings = meetingGetService.find(cardinal); From 88293c0e39ac79454357cdd9ad6056bfc970a677 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:25:31 +0900 Subject: [PATCH 15/30] =?UTF-8?q?feat=20:=20AttendanceInfo=20=EB=A7=A4?= =?UTF-8?q?=ED=95=91=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/mapper/AttendanceMapper.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/mapper/AttendanceMapper.java b/src/main/java/leets/weeth/domain/attendance/application/mapper/AttendanceMapper.java index 2f1e85db..9b6fa8c7 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/mapper/AttendanceMapper.java +++ b/src/main/java/leets/weeth/domain/attendance/application/mapper/AttendanceMapper.java @@ -32,4 +32,16 @@ public interface AttendanceMapper { @Mapping(target = "end", source = "attendance.meeting.end"), @Mapping(target = "location", source = "attendance.meeting.location"), }) AttendanceDTO.Response toResponseDto(Attendance attendance); + + @Mappings({ + @Mapping(target = "id", source = "attendance.id"), + @Mapping(target = "status", source = "attendance.status"), + @Mapping(target = "weekNumber", source = "attendance.meeting.weekNumber"), + @Mapping(target = "name", source = "attendance.user.name"), + @Mapping(target = "position", source = "attendance.user.position"), + @Mapping(target = "department", source = "attendance.user.department"), + @Mapping(target = "studentId", source = "attendance.user.studentId") + }) + AttendanceDTO.AttendanceInfo toAttendanceInfoDto(Attendance attendance); + } From c4b140955e811c43142b42649316e4a73c9f41fa Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 6 Jan 2025 15:25:59 +0900 Subject: [PATCH 16/30] =?UTF-8?q?feat=20:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EA=B0=9C=EB=B3=84=20=EC=B6=9C=EC=84=9D=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/AttendanceAdminController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java index 77c6b62d..024735a7 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java @@ -1,13 +1,16 @@ package leets.weeth.domain.attendance.presentation; import static leets.weeth.domain.attendance.presentation.ResponseMessage.ATTENDANCE_CLOSE_SUCCESS; +import static leets.weeth.domain.attendance.presentation.ResponseMessage.ATTENDANCE_FIND_DETAIL_SUCCESS; import static leets.weeth.domain.attendance.presentation.ResponseMessage.ATTENDANCE_UPDATED_SUCCESS; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import leets.weeth.domain.attendance.application.dto.AttendanceDTO.AttendanceInfo; import leets.weeth.domain.attendance.application.usecase.AttendanceUseCase; import leets.weeth.global.common.response.CommonResponse; import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -31,6 +34,12 @@ public CommonResponse close(@RequestParam LocalDate now, @RequestParam Int return CommonResponse.createSuccess(ATTENDANCE_CLOSE_SUCCESS.getMessage()); } + @GetMapping("/{attendanceId}") + @Operation(summary = "개별 출석 정보 조회") + public CommonResponse getAttendance(@PathVariable Long attendanceId) { + return CommonResponse.createSuccess(ATTENDANCE_FIND_DETAIL_SUCCESS.getMessage(), attendanceUseCase.findAttendance(attendanceId)); + } + @PatchMapping("/{attendanceId}") @Operation(summary = "출석 상태 수정") public CommonResponse updateAttendanceStatus(@PathVariable Long attendanceId) { From 4e76a9da96a1afe9d148cd79f74c91441e0225bd Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Tue, 7 Jan 2025 15:35:13 +0900 Subject: [PATCH 17/30] =?UTF-8?q?refactor=20:=20updateAttendanceStatus?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=B6=9C=EC=84=9D=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/usecase/AttendanceUseCaseImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java index e01df371..252e6862 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java @@ -102,6 +102,11 @@ public void close(LocalDate now, Integer cardinal) { public void updateAttendanceStatus(Long attendanceId) { Attendance attendance = attendanceGetService.findAttendanceId(attendanceId); + if (attendance.getStatus() == Status.ATTEND) { + attendance.close(); + } else { + attendance.attend(); + } attendanceUpdateService.updateUserAttendanceByStatus(attendance); } } From 30773051d47df798d549ab79c56232e96a2a6517 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 04:56:58 +0900 Subject: [PATCH 18/30] =?UTF-8?q?refactor=20:=20=EC=A0=95=EA=B8=B0?= =?UTF-8?q?=EB=AA=A8=EC=9E=84=20=EC=B6=9C=EC=84=9D=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=84=B1=EA=B3=B5=20=EB=A9=94=EC=84=B8?= =?UTF-8?q?=EC=A7=80=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weeth/domain/attendance/presentation/ResponseMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java b/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java index c60638d0..f3cc9cae 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/ResponseMessage.java @@ -9,7 +9,7 @@ public enum ResponseMessage { //AttendanceAdminController 관련 ATTENDANCE_CLOSE_SUCCESS("출석이 성공적으로 마감되었습니다."), ATTENDANCE_UPDATED_SUCCESS("개별 출석 상태가 성공적으로 수정되었습니다."), - ATTENDANCE_FIND_DETAIL_SUCCESS("사용자의 출석 정보가 성공적으로 조회되었습니다."), + ATTENDANCE_FIND_DETAIL_SUCCESS("모든 인원의 정기모임 출석 정보가 성공적으로 조회되었습니다."), //AttendanceController 관련 ATTENDANCE_CHECKIN_SUCCESS("출석이 성공적으로 처리되었습니다."), From d446eddaa8524ad9b7e7590f1e526ca3045a0676 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 04:57:41 +0900 Subject: [PATCH 19/30] =?UTF-8?q?feat=20:=20UpdateStatus=20DTO=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/attendance/application/dto/AttendanceDTO.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java b/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java index 7e715af4..d121a121 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java +++ b/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java @@ -45,4 +45,8 @@ public record AttendanceInfo( String department, String studentId ) {} + public record UpdateStatus( + Long attendanceId, + String status + ) {} } From 622ecacb43a5470f77a05e3aa4764dd5aaeb7606 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 04:58:05 +0900 Subject: [PATCH 20/30] =?UTF-8?q?refactor=20:=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EC=A7=80=EC=95=8A=EB=8A=94=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/domain/service/AttendanceUpdateService.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceUpdateService.java b/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceUpdateService.java index 13c7f5fd..50dad48d 100644 --- a/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceUpdateService.java +++ b/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceUpdateService.java @@ -38,7 +38,4 @@ public void updateUserAttendanceByStatus(List attendances) { } } } - public void updateUserAttendanceByStatus(Attendance attendance) { - updateUserAttendanceByStatus(List.of(attendance)); - } } From db740bc99886af49d0e9d34376aa8ec20c2bab8d Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 04:58:30 +0900 Subject: [PATCH 21/30] =?UTF-8?q?refactor=20:=20List=EB=A1=9C=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EB=B0=9B=EB=8F=84=EB=A1=9D=20=EC=9C=A0=EC=8A=A4?= =?UTF-8?q?=EC=BC=80=EC=9D=B4=EC=8A=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/application/usecase/AttendanceUseCase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java index 9918fc41..e73f1221 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCase.java @@ -1,5 +1,7 @@ package leets.weeth.domain.attendance.application.usecase; +import java.util.List; +import leets.weeth.domain.attendance.application.dto.AttendanceDTO; import leets.weeth.domain.attendance.application.dto.AttendanceDTO.AttendanceInfo; import leets.weeth.domain.attendance.application.exception.AttendanceCodeMismatchException; @@ -15,9 +17,9 @@ public interface AttendanceUseCase { Detail findAll(Long userId); - AttendanceInfo findAttendance(Long attendanceId); + List findAllAttendanceByMeeting(Long meetingId); void close(LocalDate now, Integer cardinal); - void updateAttendanceStatus(Long attendanceId); + void updateAttendanceStatus(List attendanceUpdates); } From 47defa0f755cbc49e2f05b51929b7c06e6c52169 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 04:59:18 +0900 Subject: [PATCH 22/30] =?UTF-8?q?refactor=20:=20List=EB=A1=9C=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EB=B0=9B=EC=95=84=20=EC=B2=98=EB=A6=AC=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AttendanceAdminController.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java index 024735a7..84407191 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java @@ -6,13 +6,15 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; -import leets.weeth.domain.attendance.application.dto.AttendanceDTO.AttendanceInfo; +import java.util.List; +import leets.weeth.domain.attendance.application.dto.AttendanceDTO; import leets.weeth.domain.attendance.application.usecase.AttendanceUseCase; import leets.weeth.global.common.response.CommonResponse; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -34,16 +36,16 @@ public CommonResponse close(@RequestParam LocalDate now, @RequestParam Int return CommonResponse.createSuccess(ATTENDANCE_CLOSE_SUCCESS.getMessage()); } - @GetMapping("/{attendanceId}") - @Operation(summary = "개별 출석 정보 조회") - public CommonResponse getAttendance(@PathVariable Long attendanceId) { - return CommonResponse.createSuccess(ATTENDANCE_FIND_DETAIL_SUCCESS.getMessage(), attendanceUseCase.findAttendance(attendanceId)); + @GetMapping("/{meetingId}") + @Operation(summary = "모든 인원 정기모임 출석 정보 조회") + public CommonResponse> getAllAttendance(@PathVariable Long meetingId) { + return CommonResponse.createSuccess(ATTENDANCE_FIND_DETAIL_SUCCESS.getMessage(), attendanceUseCase.findAllAttendanceByMeeting(meetingId)); } - @PatchMapping("/{attendanceId}") - @Operation(summary = "출석 상태 수정") - public CommonResponse updateAttendanceStatus(@PathVariable Long attendanceId) { - attendanceUseCase.updateAttendanceStatus(attendanceId); + @PatchMapping("/status") + @Operation(summary = "모든 인원 정기모임 출석 상태 수정") + public CommonResponse updateAttendanceStatus(@RequestBody List attendanceUpdates) { + attendanceUseCase.updateAttendanceStatus(attendanceUpdates); return CommonResponse.createSuccess(ATTENDANCE_UPDATED_SUCCESS.getMessage()); } } From ae0510e55306302166830bca248aaf6ccdd16ebc Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 04:59:43 +0900 Subject: [PATCH 23/30] =?UTF-8?q?feat=20:=20getAttendancesByMeeting=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/schedule/domain/service/MeetingGetService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/leets/weeth/domain/schedule/domain/service/MeetingGetService.java b/src/main/java/leets/weeth/domain/schedule/domain/service/MeetingGetService.java index 65fd655c..4fa201e4 100644 --- a/src/main/java/leets/weeth/domain/schedule/domain/service/MeetingGetService.java +++ b/src/main/java/leets/weeth/domain/schedule/domain/service/MeetingGetService.java @@ -1,5 +1,7 @@ package leets.weeth.domain.schedule.domain.service; +import leets.weeth.domain.attendance.domain.entity.Attendance; +import leets.weeth.domain.attendance.domain.repository.AttendanceRepository; import leets.weeth.domain.schedule.application.dto.ScheduleDTO; import leets.weeth.domain.schedule.application.mapper.ScheduleMapper; import leets.weeth.domain.schedule.domain.entity.Meeting; @@ -16,6 +18,7 @@ public class MeetingGetService { private final MeetingRepository meetingRepository; + private final AttendanceRepository attendanceRepository; private final ScheduleMapper mapper; public Meeting find(Long meetingId) { @@ -36,4 +39,6 @@ public List find(Integer cardinal) { public List findAll() { return meetingRepository.findAll(); } + + public List getAttendancesByMeeting(Meeting meeting) {return attendanceRepository.findAllByMeeting(meeting);} } From a5174f5e959fdb816e27282a2c680fb2013010bd Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 05:00:22 +0900 Subject: [PATCH 24/30] =?UTF-8?q?refactor=20:=20List=EB=A1=9C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8A=94=20findAllAt?= =?UTF-8?q?tendanceByMeeting=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../usecase/AttendanceUseCaseImpl.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java index 252e6862..db3e680a 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java @@ -74,11 +74,14 @@ public AttendanceDTO.Detail findAll(Long userId) { return mapper.toDetailDto(user, responses); } @Override - public AttendanceDTO.AttendanceInfo findAttendance(Long attendanceId) { + public List findAllAttendanceByMeeting(Long meetingId) { + Meeting meeting = meetingGetService.find(meetingId); - Attendance attendance = attendanceGetService.findAttendanceId(attendanceId); + List attendances = meetingGetService.getAttendancesByMeeting(meeting); - return mapper.toAttendanceInfoDto(attendance); + return attendances.stream() + .map(mapper::toAttendanceInfoDto) + .toList(); } @Override public void close(LocalDate now, Integer cardinal) { @@ -99,14 +102,18 @@ public void close(LocalDate now, Integer cardinal) { } @Override @Transactional - public void updateAttendanceStatus(Long attendanceId) { - Attendance attendance = attendanceGetService.findAttendanceId(attendanceId); - - if (attendance.getStatus() == Status.ATTEND) { - attendance.close(); - } else { - attendance.attend(); - } - attendanceUpdateService.updateUserAttendanceByStatus(attendance); + public void updateAttendanceStatus(List attendanceUpdates) { + attendanceUpdates.forEach(update -> { + Attendance attendance = attendanceGetService.findAttendanceId(update.attendanceId()); + User user = attendance.getUser(); + + if (attendance.getStatus() == Status.ATTEND) { + attendance.close(); + user.removeAttend(); + } else { + attendance.attend(); + user.removeAbsent(); + } + }); } } From 5b1f1a86850edd2066fa5873a5c1c3cdea5431d8 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 05:04:06 +0900 Subject: [PATCH 25/30] =?UTF-8?q?refactor=20:=20=EA=B0=9C=EB=B3=84=20?= =?UTF-8?q?=EC=B6=9C=EC=84=9D=20=EB=B3=80=EA=B2=BD=20api=20Operation=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/presentation/AttendanceAdminController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java index 84407191..4dfc223b 100644 --- a/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java +++ b/src/main/java/leets/weeth/domain/attendance/presentation/AttendanceAdminController.java @@ -43,7 +43,7 @@ public CommonResponse> getAllAttendance(@Path } @PatchMapping("/status") - @Operation(summary = "모든 인원 정기모임 출석 상태 수정") + @Operation(summary = "모든 인원 정기모임 개별 출석 상태 수정") public CommonResponse updateAttendanceStatus(@RequestBody List attendanceUpdates) { attendanceUseCase.updateAttendanceStatus(attendanceUpdates); return CommonResponse.createSuccess(ATTENDANCE_UPDATED_SUCCESS.getMessage()); From 6ba4f92cd74b9834bf6a8b05b04201f93d31abeb Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 16:22:47 +0900 Subject: [PATCH 26/30] =?UTF-8?q?refactor=20:=20DTO=20=ED=81=B4=EB=9E=98?= =?UTF-8?q?=EC=8A=A4=EA=B0=84=20=EB=B9=88=EC=A4=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weeth/domain/attendance/application/dto/AttendanceDTO.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java b/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java index d121a121..7c6638e8 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java +++ b/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java @@ -36,6 +36,7 @@ public record Response( public record CheckIn( Integer code ) {} + public record AttendanceInfo( Long id, Status status, @@ -45,6 +46,7 @@ public record AttendanceInfo( String department, String studentId ) {} + public record UpdateStatus( Long attendanceId, String status From 4be60caf1a7047c2bbcf30bfe3785cf51820808f Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 16:42:53 +0900 Subject: [PATCH 27/30] =?UTF-8?q?refactor=20:=20DTO=EB=8B=A8=EC=97=90?= =?UTF-8?q?=EC=84=9C=20notnull=20Pattern=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/attendance/application/dto/AttendanceDTO.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java b/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java index 7c6638e8..394b21c3 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java +++ b/src/main/java/leets/weeth/domain/attendance/application/dto/AttendanceDTO.java @@ -1,5 +1,7 @@ package leets.weeth.domain.attendance.application.dto; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; import leets.weeth.domain.attendance.domain.entity.enums.Status; import java.time.LocalDateTime; @@ -48,7 +50,7 @@ public record AttendanceInfo( ) {} public record UpdateStatus( - Long attendanceId, - String status + @NotNull Long attendanceId, + @NotNull @Pattern(regexp = "ATTEND|ABSENT")String status ) {} } From a5ed79e713024b4896b242d9c1311f411dade871 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 16:44:15 +0900 Subject: [PATCH 28/30] =?UTF-8?q?refactor=20:=20findByAttendanceId=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=EB=A1=9C=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=EB=AA=85=20=EC=A7=81=EA=B4=80=EC=A0=81=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/attendance/domain/service/AttendanceGetService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceGetService.java b/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceGetService.java index 5b45d947..d0dd1ad0 100644 --- a/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceGetService.java +++ b/src/main/java/leets/weeth/domain/attendance/domain/service/AttendanceGetService.java @@ -18,7 +18,7 @@ public class AttendanceGetService { public List findAllByMeeting(Meeting meeting) { return attendanceRepository.findAllByMeeting(meeting); } - public Attendance findAttendanceId(Long attendanceId) { + public Attendance findByAttendanceId(Long attendanceId) { return attendanceRepository.findById(attendanceId) .orElseThrow(AttendanceNotFoundException::new); } From 060333e399537c3905e07d812dac4c6ca53923cd Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 16:44:59 +0900 Subject: [PATCH 29/30] =?UTF-8?q?refactor=20:=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20findAllByMeeting=20=EC=9E=AC?= =?UTF-8?q?=ED=99=9C=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendance/application/usecase/AttendanceUseCaseImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java index db3e680a..bdaaab5f 100644 --- a/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java +++ b/src/main/java/leets/weeth/domain/attendance/application/usecase/AttendanceUseCaseImpl.java @@ -77,7 +77,7 @@ public AttendanceDTO.Detail findAll(Long userId) { public List findAllAttendanceByMeeting(Long meetingId) { Meeting meeting = meetingGetService.find(meetingId); - List attendances = meetingGetService.getAttendancesByMeeting(meeting); + List attendances = attendanceGetService.findAllByMeeting(meeting); return attendances.stream() .map(mapper::toAttendanceInfoDto) @@ -104,7 +104,7 @@ public void close(LocalDate now, Integer cardinal) { @Transactional public void updateAttendanceStatus(List attendanceUpdates) { attendanceUpdates.forEach(update -> { - Attendance attendance = attendanceGetService.findAttendanceId(update.attendanceId()); + Attendance attendance = attendanceGetService.findByAttendanceId(update.attendanceId()); User user = attendance.getUser(); if (attendance.getStatus() == Status.ATTEND) { From b04b4fc26152c9b2fd2a89837383e0382dd326e4 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Thu, 9 Jan 2025 16:46:06 +0900 Subject: [PATCH 30/30] =?UTF-8?q?refactor=20:=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/schedule/domain/service/MeetingGetService.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/leets/weeth/domain/schedule/domain/service/MeetingGetService.java b/src/main/java/leets/weeth/domain/schedule/domain/service/MeetingGetService.java index 4fa201e4..65fd655c 100644 --- a/src/main/java/leets/weeth/domain/schedule/domain/service/MeetingGetService.java +++ b/src/main/java/leets/weeth/domain/schedule/domain/service/MeetingGetService.java @@ -1,7 +1,5 @@ package leets.weeth.domain.schedule.domain.service; -import leets.weeth.domain.attendance.domain.entity.Attendance; -import leets.weeth.domain.attendance.domain.repository.AttendanceRepository; import leets.weeth.domain.schedule.application.dto.ScheduleDTO; import leets.weeth.domain.schedule.application.mapper.ScheduleMapper; import leets.weeth.domain.schedule.domain.entity.Meeting; @@ -18,7 +16,6 @@ public class MeetingGetService { private final MeetingRepository meetingRepository; - private final AttendanceRepository attendanceRepository; private final ScheduleMapper mapper; public Meeting find(Long meetingId) { @@ -39,6 +36,4 @@ public List find(Integer cardinal) { public List findAll() { return meetingRepository.findAll(); } - - public List getAttendancesByMeeting(Meeting meeting) {return attendanceRepository.findAllByMeeting(meeting);} }