diff --git a/src/main/java/com/waruru/areyouhere/attendance/controller/AttendanceController.java b/src/main/java/com/waruru/areyouhere/attendance/controller/AttendanceController.java index 796e6d8..4704cdc 100644 --- a/src/main/java/com/waruru/areyouhere/attendance/controller/AttendanceController.java +++ b/src/main/java/com/waruru/areyouhere/attendance/controller/AttendanceController.java @@ -1,10 +1,10 @@ package com.waruru.areyouhere.attendance.controller; -import com.waruru.areyouhere.attendance.dto.AttendRequestDto; -import com.waruru.areyouhere.attendance.dto.AttendResponseDto; -import com.waruru.areyouhere.attendance.dto.CurrentAttendanceCount; +import com.waruru.areyouhere.attendance.dto.request.AttendRequestDto; +import com.waruru.areyouhere.attendance.dto.response.AttendResponseDto; +import com.waruru.areyouhere.attendance.dto.response.CurrentAttendanceCountResponseDto; import com.waruru.areyouhere.attendance.dto.UpdateAttendance; -import com.waruru.areyouhere.attendance.dto.UpdateAttendanceRequestDto; +import com.waruru.areyouhere.attendance.dto.request.UpdateAttendanceRequestDto; import com.waruru.areyouhere.attendance.exception.DuplicateAuthCodeAttendException; import com.waruru.areyouhere.attendance.service.AttendanceService; import com.waruru.areyouhere.attendance.service.dto.CurrentSessionAttendeeAttendance; @@ -97,10 +97,10 @@ ResponseEntity updateAttendances(@RequestBody UpdateAttendanceReques @LoginRequired @GetMapping - ResponseEntity getCurrentAttendances(@RequestParam("courseId") Long courseId, @RequestParam("sessionId") Long sessionId){ + ResponseEntity getCurrentAttendances(@RequestParam("courseId") Long courseId, @RequestParam("sessionId") Long sessionId){ int currentAttendance = attendanceService.currentAttendance(sessionId); int total = attendeeService.getAttendeeByCourseId(courseId); - return ResponseEntity.ok(new CurrentAttendanceCount(currentAttendance, total)); + return ResponseEntity.ok(new CurrentAttendanceCountResponseDto(currentAttendance, total)); } @LoginRequired diff --git a/src/main/java/com/waruru/areyouhere/attendance/controller/AuthCodeController.java b/src/main/java/com/waruru/areyouhere/attendance/controller/AuthCodeController.java index 949691d..4abb415 100644 --- a/src/main/java/com/waruru/areyouhere/attendance/controller/AuthCodeController.java +++ b/src/main/java/com/waruru/areyouhere/attendance/controller/AuthCodeController.java @@ -5,8 +5,8 @@ import com.waruru.areyouhere.course.domain.entity.Course; import com.waruru.areyouhere.course.service.CourseService; import com.waruru.areyouhere.session.domain.entity.Session; -import com.waruru.areyouhere.attendance.dto.AuthCodeDeactivationRequestDto; -import com.waruru.areyouhere.attendance.dto.AuthCodeRequestDto; +import com.waruru.areyouhere.attendance.dto.request.AuthCodeDeactivationRequestDto; +import com.waruru.areyouhere.attendance.dto.request.AuthCodeRequestDto; import com.waruru.areyouhere.attendance.service.AuthCodeService; import com.waruru.areyouhere.session.service.SessionService; import java.time.LocalDateTime; diff --git a/src/main/java/com/waruru/areyouhere/attendance/dto/AttendRequestDto.java b/src/main/java/com/waruru/areyouhere/attendance/dto/request/AttendRequestDto.java similarity index 74% rename from src/main/java/com/waruru/areyouhere/attendance/dto/AttendRequestDto.java rename to src/main/java/com/waruru/areyouhere/attendance/dto/request/AttendRequestDto.java index c13756c..bdb7066 100644 --- a/src/main/java/com/waruru/areyouhere/attendance/dto/AttendRequestDto.java +++ b/src/main/java/com/waruru/areyouhere/attendance/dto/request/AttendRequestDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.attendance.dto; +package com.waruru.areyouhere.attendance.dto.request; import lombok.Data; diff --git a/src/main/java/com/waruru/areyouhere/attendance/dto/AuthCodeDeactivationRequestDto.java b/src/main/java/com/waruru/areyouhere/attendance/dto/request/AuthCodeDeactivationRequestDto.java similarity index 84% rename from src/main/java/com/waruru/areyouhere/attendance/dto/AuthCodeDeactivationRequestDto.java rename to src/main/java/com/waruru/areyouhere/attendance/dto/request/AuthCodeDeactivationRequestDto.java index 68ff938..89c1000 100644 --- a/src/main/java/com/waruru/areyouhere/attendance/dto/AuthCodeDeactivationRequestDto.java +++ b/src/main/java/com/waruru/areyouhere/attendance/dto/request/AuthCodeDeactivationRequestDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.attendance.dto; +package com.waruru.areyouhere.attendance.dto.request; import lombok.AccessLevel; diff --git a/src/main/java/com/waruru/areyouhere/attendance/dto/AuthCodeRequestDto.java b/src/main/java/com/waruru/areyouhere/attendance/dto/request/AuthCodeRequestDto.java similarity index 78% rename from src/main/java/com/waruru/areyouhere/attendance/dto/AuthCodeRequestDto.java rename to src/main/java/com/waruru/areyouhere/attendance/dto/request/AuthCodeRequestDto.java index ab76fe5..afafac6 100644 --- a/src/main/java/com/waruru/areyouhere/attendance/dto/AuthCodeRequestDto.java +++ b/src/main/java/com/waruru/areyouhere/attendance/dto/request/AuthCodeRequestDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.attendance.dto; +package com.waruru.areyouhere.attendance.dto.request; import jakarta.validation.constraints.NotNull; import lombok.Data; diff --git a/src/main/java/com/waruru/areyouhere/attendance/dto/UpdateAttendanceRequestDto.java b/src/main/java/com/waruru/areyouhere/attendance/dto/request/UpdateAttendanceRequestDto.java similarity index 60% rename from src/main/java/com/waruru/areyouhere/attendance/dto/UpdateAttendanceRequestDto.java rename to src/main/java/com/waruru/areyouhere/attendance/dto/request/UpdateAttendanceRequestDto.java index e6f3788..e560084 100644 --- a/src/main/java/com/waruru/areyouhere/attendance/dto/UpdateAttendanceRequestDto.java +++ b/src/main/java/com/waruru/areyouhere/attendance/dto/request/UpdateAttendanceRequestDto.java @@ -1,5 +1,6 @@ -package com.waruru.areyouhere.attendance.dto; +package com.waruru.areyouhere.attendance.dto.request; +import com.waruru.areyouhere.attendance.dto.UpdateAttendance; import java.util.List; import lombok.Data; diff --git a/src/main/java/com/waruru/areyouhere/attendance/dto/AttendResponseDto.java b/src/main/java/com/waruru/areyouhere/attendance/dto/response/AttendResponseDto.java similarity index 94% rename from src/main/java/com/waruru/areyouhere/attendance/dto/AttendResponseDto.java rename to src/main/java/com/waruru/areyouhere/attendance/dto/response/AttendResponseDto.java index 4959a41..e1d4691 100644 --- a/src/main/java/com/waruru/areyouhere/attendance/dto/AttendResponseDto.java +++ b/src/main/java/com/waruru/areyouhere/attendance/dto/response/AttendResponseDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.attendance.dto; +package com.waruru.areyouhere.attendance.dto.response; import com.waruru.areyouhere.attendee.service.dto.AttendeeInfo; import java.time.LocalDateTime; diff --git a/src/main/java/com/waruru/areyouhere/attendance/dto/CurrentAttendanceCount.java b/src/main/java/com/waruru/areyouhere/attendance/dto/response/CurrentAttendanceCountResponseDto.java similarity index 56% rename from src/main/java/com/waruru/areyouhere/attendance/dto/CurrentAttendanceCount.java rename to src/main/java/com/waruru/areyouhere/attendance/dto/response/CurrentAttendanceCountResponseDto.java index e6fd40b..78dea3d 100644 --- a/src/main/java/com/waruru/areyouhere/attendance/dto/CurrentAttendanceCount.java +++ b/src/main/java/com/waruru/areyouhere/attendance/dto/response/CurrentAttendanceCountResponseDto.java @@ -1,11 +1,11 @@ -package com.waruru.areyouhere.attendance.dto; +package com.waruru.areyouhere.attendance.dto.response; import lombok.AllArgsConstructor; import lombok.Data; @Data @AllArgsConstructor -public class CurrentAttendanceCount { +public class CurrentAttendanceCountResponseDto { private int attendances; private int total; } diff --git a/src/main/java/com/waruru/areyouhere/attendee/controller/AttendeeController.java b/src/main/java/com/waruru/areyouhere/attendee/controller/AttendeeController.java index 087632f..a0b1854 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/controller/AttendeeController.java +++ b/src/main/java/com/waruru/areyouhere/attendee/controller/AttendeeController.java @@ -1,12 +1,11 @@ package com.waruru.areyouhere.attendee.controller; -import com.waruru.areyouhere.attendee.dto.AttendeeDetailDto; -import com.waruru.areyouhere.attendee.dto.ClassAttendeesDto; -import com.waruru.areyouhere.attendee.dto.DeleteAttendeesDto; -import com.waruru.areyouhere.attendee.dto.DuplicateCheckAttendeesDto; -import com.waruru.areyouhere.attendee.dto.NewAttendeesDto; +import com.waruru.areyouhere.attendee.service.dto.AttendeeDetailDto; +import com.waruru.areyouhere.attendee.dto.response.ClassAttendeesResponseDto; +import com.waruru.areyouhere.attendee.dto.request.DeleteAttendeesRequestDto; +import com.waruru.areyouhere.attendee.dto.request.DuplicateCheckAttendeesRequestDto; +import com.waruru.areyouhere.attendee.dto.request.NewAttendeesRequestDto; import com.waruru.areyouhere.attendee.service.AttendeeService; -import com.waruru.areyouhere.attendee.service.dto.AttendeeAttendanceInfo; import com.waruru.areyouhere.attendee.service.dto.ClassAttendees; import com.waruru.areyouhere.attendee.service.dto.DuplicateAttendees; import com.waruru.areyouhere.common.annotation.LoginRequired; @@ -33,32 +32,32 @@ public class AttendeeController { @LoginRequired @GetMapping - public ResponseEntity getClassAttendees(@RequestParam("courseId") Long courseId){ + public ResponseEntity getClassAttendees(@RequestParam("courseId") Long courseId){ List classAttendees = attendeeService.getClassAttendeesIfExistsOrEmpty(courseId); - return ResponseEntity.ok(ClassAttendeesDto.builder() + return ResponseEntity.ok(ClassAttendeesResponseDto.builder() .classAttendees(classAttendees) .build()); } @LoginRequired @PostMapping - public ResponseEntity create(@RequestBody NewAttendeesDto newAttendeesDto){ - attendeeService.createAttendees(newAttendeesDto.getCourseId(), newAttendeesDto.getNewAttendees()); + public ResponseEntity create(@RequestBody NewAttendeesRequestDto newAttendeesRequestDto){ + attendeeService.createAttendees(newAttendeesRequestDto.getCourseId(), newAttendeesRequestDto.getNewAttendees()); return ResponseEntity.ok().build(); } @LoginRequired @PostMapping("/delete") - public ResponseEntity delete(@RequestBody DeleteAttendeesDto deleteAttendeesDto){ - attendeeService.deleteAttendees(deleteAttendeesDto.getAttendeeIds()); + public ResponseEntity delete(@RequestBody DeleteAttendeesRequestDto deleteAttendeesRequestDto){ + attendeeService.deleteAttendees(deleteAttendeesRequestDto.getAttendeeIds()); return ResponseEntity.ok().build(); } @LoginRequired @PostMapping("/duplicate") - public ResponseEntity checkDuplicate(@RequestBody DuplicateCheckAttendeesDto duplicateCheckAttendeesDto){ - return ResponseEntity.ok(attendeeService.getDuplicateAttendees(duplicateCheckAttendeesDto.getCourseId(), duplicateCheckAttendeesDto.getNewAttendees())); + public ResponseEntity checkDuplicate(@RequestBody DuplicateCheckAttendeesRequestDto duplicateCheckAttendeesRequestDto){ + return ResponseEntity.ok(attendeeService.getDuplicateAttendees(duplicateCheckAttendeesRequestDto.getCourseId(), duplicateCheckAttendeesRequestDto.getNewAttendees())); } @LoginRequired diff --git a/src/main/java/com/waruru/areyouhere/attendee/dto/DeleteAttendeesDto.java b/src/main/java/com/waruru/areyouhere/attendee/dto/DeleteAttendeesDto.java deleted file mode 100644 index 5e62074..0000000 --- a/src/main/java/com/waruru/areyouhere/attendee/dto/DeleteAttendeesDto.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.waruru.areyouhere.attendee.dto; - -import java.util.List; -import lombok.Data; - -@Data -public class DeleteAttendeesDto { - List attendeeIds; -} diff --git a/src/main/java/com/waruru/areyouhere/attendee/dto/NewAttendeesDto.java b/src/main/java/com/waruru/areyouhere/attendee/dto/NewAttendeesDto.java deleted file mode 100644 index fadf336..0000000 --- a/src/main/java/com/waruru/areyouhere/attendee/dto/NewAttendeesDto.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.waruru.areyouhere.attendee.dto; - -import java.util.List; -import lombok.Data; - - -@Data -public class NewAttendeesDto { - private Long courseId; - - List newAttendees; -} - diff --git a/src/main/java/com/waruru/areyouhere/attendee/dto/request/DeleteAttendeesRequestDto.java b/src/main/java/com/waruru/areyouhere/attendee/dto/request/DeleteAttendeesRequestDto.java new file mode 100644 index 0000000..b8f9d6b --- /dev/null +++ b/src/main/java/com/waruru/areyouhere/attendee/dto/request/DeleteAttendeesRequestDto.java @@ -0,0 +1,9 @@ +package com.waruru.areyouhere.attendee.dto.request; + +import java.util.List; +import lombok.Data; + +@Data +public class DeleteAttendeesRequestDto { + List attendeeIds; +} diff --git a/src/main/java/com/waruru/areyouhere/attendee/dto/DuplicateCheckAttendeesDto.java b/src/main/java/com/waruru/areyouhere/attendee/dto/request/DuplicateCheckAttendeesRequestDto.java similarity index 55% rename from src/main/java/com/waruru/areyouhere/attendee/dto/DuplicateCheckAttendeesDto.java rename to src/main/java/com/waruru/areyouhere/attendee/dto/request/DuplicateCheckAttendeesRequestDto.java index a239e9e..28a0b09 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/dto/DuplicateCheckAttendeesDto.java +++ b/src/main/java/com/waruru/areyouhere/attendee/dto/request/DuplicateCheckAttendeesRequestDto.java @@ -1,11 +1,11 @@ -package com.waruru.areyouhere.attendee.dto; +package com.waruru.areyouhere.attendee.dto.request; import java.util.List; import lombok.Getter; @Getter -public class DuplicateCheckAttendeesDto { +public class DuplicateCheckAttendeesRequestDto { private Long courseId; private List newAttendees; } diff --git a/src/main/java/com/waruru/areyouhere/attendee/dto/request/NewAttendeesRequestDto.java b/src/main/java/com/waruru/areyouhere/attendee/dto/request/NewAttendeesRequestDto.java new file mode 100644 index 0000000..1035d60 --- /dev/null +++ b/src/main/java/com/waruru/areyouhere/attendee/dto/request/NewAttendeesRequestDto.java @@ -0,0 +1,14 @@ +package com.waruru.areyouhere.attendee.dto.request; + +import com.waruru.areyouhere.attendee.service.dto.AttendeeData; +import java.util.List; +import lombok.Data; + + +@Data +public class NewAttendeesRequestDto { + private Long courseId; + + List newAttendees; +} + diff --git a/src/main/java/com/waruru/areyouhere/attendee/dto/ClassAttendeesDto.java b/src/main/java/com/waruru/areyouhere/attendee/dto/response/ClassAttendeesResponseDto.java similarity index 68% rename from src/main/java/com/waruru/areyouhere/attendee/dto/ClassAttendeesDto.java rename to src/main/java/com/waruru/areyouhere/attendee/dto/response/ClassAttendeesResponseDto.java index 44f89d8..46d597b 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/dto/ClassAttendeesDto.java +++ b/src/main/java/com/waruru/areyouhere/attendee/dto/response/ClassAttendeesResponseDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.attendee.dto; +package com.waruru.areyouhere.attendee.dto.response; import com.waruru.areyouhere.attendee.service.dto.ClassAttendees; import java.util.List; @@ -10,12 +10,12 @@ @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) -public class ClassAttendeesDto { +public class ClassAttendeesResponseDto { private List classAttendees; @Builder - public ClassAttendeesDto(List classAttendees) { + public ClassAttendeesResponseDto(List classAttendees) { this.classAttendees = classAttendees; } } diff --git a/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeService.java b/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeService.java index 4c88553..a985c48 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeService.java +++ b/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeService.java @@ -1,8 +1,7 @@ package com.waruru.areyouhere.attendee.service; -import com.waruru.areyouhere.attendee.dto.AttendeeData; -import com.waruru.areyouhere.attendee.dto.AttendeeDetailDto; -import com.waruru.areyouhere.attendee.service.dto.AttendeeAttendanceInfo; +import com.waruru.areyouhere.attendee.service.dto.AttendeeData; +import com.waruru.areyouhere.attendee.service.dto.AttendeeDetailDto; import com.waruru.areyouhere.attendee.service.dto.ClassAttendees; import com.waruru.areyouhere.attendee.service.dto.DuplicateAttendees; import com.waruru.areyouhere.attendee.service.dto.SessionAttendees; diff --git a/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeServiceImpl.java b/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeServiceImpl.java index 15496ab..71ac467 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeServiceImpl.java +++ b/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeServiceImpl.java @@ -7,8 +7,8 @@ import com.waruru.areyouhere.attendee.domain.repository.dto.AttendeeAttendDetailInfo; import com.waruru.areyouhere.attendee.domain.repository.dto.ClassAttendeeInfo; import com.waruru.areyouhere.attendee.domain.repository.dto.SessionAttendeeInfo; -import com.waruru.areyouhere.attendee.dto.AttendeeData; -import com.waruru.areyouhere.attendee.dto.AttendeeDetailDto; +import com.waruru.areyouhere.attendee.service.dto.AttendeeData; +import com.waruru.areyouhere.attendee.service.dto.AttendeeDetailDto; import com.waruru.areyouhere.attendee.exception.ClassAttendeesEmptyException; import com.waruru.areyouhere.attendee.exception.SessionAttendeesEmptyException; import com.waruru.areyouhere.attendee.service.dto.AttendeeAttendanceInfo; diff --git a/src/main/java/com/waruru/areyouhere/attendee/dto/AttendeeData.java b/src/main/java/com/waruru/areyouhere/attendee/service/dto/AttendeeData.java similarity index 67% rename from src/main/java/com/waruru/areyouhere/attendee/dto/AttendeeData.java rename to src/main/java/com/waruru/areyouhere/attendee/service/dto/AttendeeData.java index f86482f..d96ab0e 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/dto/AttendeeData.java +++ b/src/main/java/com/waruru/areyouhere/attendee/service/dto/AttendeeData.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.attendee.dto; +package com.waruru.areyouhere.attendee.service.dto; import lombok.Data; diff --git a/src/main/java/com/waruru/areyouhere/attendee/dto/AttendeeDetailDto.java b/src/main/java/com/waruru/areyouhere/attendee/service/dto/AttendeeDetailDto.java similarity index 90% rename from src/main/java/com/waruru/areyouhere/attendee/dto/AttendeeDetailDto.java rename to src/main/java/com/waruru/areyouhere/attendee/service/dto/AttendeeDetailDto.java index 2e03c52..12c5656 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/dto/AttendeeDetailDto.java +++ b/src/main/java/com/waruru/areyouhere/attendee/service/dto/AttendeeDetailDto.java @@ -1,8 +1,7 @@ -package com.waruru.areyouhere.attendee.dto; +package com.waruru.areyouhere.attendee.service.dto; import com.waruru.areyouhere.attendee.domain.repository.dto.AttendeeAttendDetailInfo; -import com.waruru.areyouhere.attendee.service.dto.AttendeeAttendanceInfo; import java.util.List; import lombok.AccessLevel; import lombok.Builder; diff --git a/src/main/java/com/waruru/areyouhere/course/dto/request/CourseCreationRequest.java b/src/main/java/com/waruru/areyouhere/course/dto/request/CourseCreationRequest.java index 6dbef76..6909e0d 100644 --- a/src/main/java/com/waruru/areyouhere/course/dto/request/CourseCreationRequest.java +++ b/src/main/java/com/waruru/areyouhere/course/dto/request/CourseCreationRequest.java @@ -1,6 +1,6 @@ package com.waruru.areyouhere.course.dto.request; -import com.waruru.areyouhere.attendee.dto.AttendeeData; +import com.waruru.areyouhere.attendee.service.dto.AttendeeData; import jakarta.validation.constraints.NotEmpty; import lombok.*; diff --git a/src/main/java/com/waruru/areyouhere/course/service/CourseService.java b/src/main/java/com/waruru/areyouhere/course/service/CourseService.java index 10aab24..305f7c1 100644 --- a/src/main/java/com/waruru/areyouhere/course/service/CourseService.java +++ b/src/main/java/com/waruru/areyouhere/course/service/CourseService.java @@ -1,6 +1,6 @@ package com.waruru.areyouhere.course.service; -import com.waruru.areyouhere.attendee.dto.AttendeeData; +import com.waruru.areyouhere.attendee.service.dto.AttendeeData; import com.waruru.areyouhere.course.domain.entity.Course; import com.waruru.areyouhere.course.dto.CourseData; import org.springframework.web.bind.annotation.RestController; diff --git a/src/main/java/com/waruru/areyouhere/course/service/CourseServiceImpl.java b/src/main/java/com/waruru/areyouhere/course/service/CourseServiceImpl.java index 8905073..30ac77e 100644 --- a/src/main/java/com/waruru/areyouhere/course/service/CourseServiceImpl.java +++ b/src/main/java/com/waruru/areyouhere/course/service/CourseServiceImpl.java @@ -5,9 +5,7 @@ import com.waruru.areyouhere.attendee.domain.repository.AttendeeBatchRepository; import com.waruru.areyouhere.attendee.domain.repository.AttendeeRepository; import com.waruru.areyouhere.attendee.domain.repository.dto.EachClassAttendeeCountInfo; -import com.waruru.areyouhere.attendee.dto.AttendeeData; -import com.waruru.areyouhere.auth.session.SessionManager; -import com.waruru.areyouhere.common.utils.RandomIdentifierGenerator; +import com.waruru.areyouhere.attendee.service.dto.AttendeeData; import com.waruru.areyouhere.course.domain.entity.Course; import com.waruru.areyouhere.course.domain.repository.CourseRepository; import com.waruru.areyouhere.attendee.exception.AttendeesNotUniqueException; @@ -20,8 +18,6 @@ import java.util.Set; import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.SetOperations; import org.springframework.transaction.annotation.Transactional; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -36,7 +32,6 @@ public class CourseServiceImpl implements CourseService { private final CourseRepository courseRepository; private final ManagerRepository managerRepository; - private final SessionManager sessionManager; private final AttendeeBatchRepository attendeeBatchRepository; private final AttendeeRepository attendeeRepository; private final AttendanceRepository attendanceRepository; diff --git a/src/main/java/com/waruru/areyouhere/manager/service/SessionManagerService.java b/src/main/java/com/waruru/areyouhere/manager/service/SessionManagerService.java index 016d1a2..a22a40f 100644 --- a/src/main/java/com/waruru/areyouhere/manager/service/SessionManagerService.java +++ b/src/main/java/com/waruru/areyouhere/manager/service/SessionManagerService.java @@ -84,4 +84,8 @@ public void update(Long userId, String name, String password){ Manager manager = managerRepository.findById(userId).orElseThrow(UnAuthenticatedException::new); managerRepository.save(manager.update(name, passwordEncoder.encode(password))); } + + public void delete(Long userId){ + managerRepository.deleteById(userId); + } } diff --git a/src/main/java/com/waruru/areyouhere/session/controller/DashBoardController.java b/src/main/java/com/waruru/areyouhere/session/controller/DashBoardController.java index 8a415ce..af113dd 100644 --- a/src/main/java/com/waruru/areyouhere/session/controller/DashBoardController.java +++ b/src/main/java/com/waruru/areyouhere/session/controller/DashBoardController.java @@ -2,15 +2,14 @@ import com.waruru.areyouhere.common.annotation.LoginRequired; -import com.waruru.areyouhere.session.dto.CurrentSessionResponseDto; -import com.waruru.areyouhere.session.dto.PreviousFiveSessionResponseDto; +import com.waruru.areyouhere.session.dto.response.CurrentSessionResponseDto; +import com.waruru.areyouhere.session.dto.response.PreviousFiveSessionResponseDto; import com.waruru.areyouhere.session.exception.CurrentSessionNotFoundException; import com.waruru.areyouhere.session.service.SessionService; import com.waruru.areyouhere.session.service.dto.CurrentSessionDto; import com.waruru.areyouhere.session.service.dto.SessionAttendanceInfo; import java.util.List; import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/src/main/java/com/waruru/areyouhere/session/controller/SessionController.java b/src/main/java/com/waruru/areyouhere/session/controller/SessionController.java index d6eb77d..8a72d7d 100644 --- a/src/main/java/com/waruru/areyouhere/session/controller/SessionController.java +++ b/src/main/java/com/waruru/areyouhere/session/controller/SessionController.java @@ -3,9 +3,8 @@ import com.waruru.areyouhere.attendee.service.AttendeeService; import com.waruru.areyouhere.attendee.service.dto.SessionAttendees; -import com.waruru.areyouhere.session.dto.CreateSessionRequestDto; -import com.waruru.areyouhere.session.dto.DeleteSessionRequestDto; -import com.waruru.areyouhere.session.dto.SessionAttendeesDto; +import com.waruru.areyouhere.session.dto.request.CreateSessionRequestDto; +import com.waruru.areyouhere.session.dto.response.SessionAttendeesResponseDto; import com.waruru.areyouhere.session.service.SessionService; import com.waruru.areyouhere.session.service.dto.AllSessionAttendanceInfo; import com.waruru.areyouhere.session.service.dto.SessionAttendanceInfo; @@ -64,21 +63,21 @@ public ResponseEntity getSessionBasicInfo(@PathVariable(" } @GetMapping("/{sessionId}/attendee") - public ResponseEntity getSessionAllAttendees(@PathVariable("sessionId") Long sessionId){ + public ResponseEntity getSessionAllAttendees(@PathVariable("sessionId") Long sessionId){ List sessionAttendees = attendeeService.getSessionAttendeesIfExistsOrEmpty( sessionId); - return ResponseEntity.ok(SessionAttendeesDto.builder() + return ResponseEntity.ok(SessionAttendeesResponseDto.builder() .sessionAttendees(sessionAttendees) .build()); } @GetMapping("/{sessionId}/absentee") - public ResponseEntity getSessionAbsenteeOnly(@PathVariable("sessionId") Long sessionId){ + public ResponseEntity getSessionAbsenteeOnly(@PathVariable("sessionId") Long sessionId){ List sessionAttendees = attendeeService.getSessionAbsenteesIfExistsOrEmpty( sessionId); - return ResponseEntity.ok(SessionAttendeesDto.builder() + return ResponseEntity.ok(SessionAttendeesResponseDto.builder() .sessionAttendees(sessionAttendees) .build()); } diff --git a/src/main/java/com/waruru/areyouhere/session/dto/CreateSessionRequestDto.java b/src/main/java/com/waruru/areyouhere/session/dto/request/CreateSessionRequestDto.java similarity index 68% rename from src/main/java/com/waruru/areyouhere/session/dto/CreateSessionRequestDto.java rename to src/main/java/com/waruru/areyouhere/session/dto/request/CreateSessionRequestDto.java index 8c31c94..83346a7 100644 --- a/src/main/java/com/waruru/areyouhere/session/dto/CreateSessionRequestDto.java +++ b/src/main/java/com/waruru/areyouhere/session/dto/request/CreateSessionRequestDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.session.dto; +package com.waruru.areyouhere.session.dto.request; import lombok.Data; diff --git a/src/main/java/com/waruru/areyouhere/session/dto/DeleteSessionRequestDto.java b/src/main/java/com/waruru/areyouhere/session/dto/request/DeleteSessionRequestDto.java similarity index 65% rename from src/main/java/com/waruru/areyouhere/session/dto/DeleteSessionRequestDto.java rename to src/main/java/com/waruru/areyouhere/session/dto/request/DeleteSessionRequestDto.java index 6368630..a330bc4 100644 --- a/src/main/java/com/waruru/areyouhere/session/dto/DeleteSessionRequestDto.java +++ b/src/main/java/com/waruru/areyouhere/session/dto/request/DeleteSessionRequestDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.session.dto; +package com.waruru.areyouhere.session.dto.request; import lombok.Data; diff --git a/src/main/java/com/waruru/areyouhere/session/dto/CurrentSessionResponseDto.java b/src/main/java/com/waruru/areyouhere/session/dto/response/CurrentSessionResponseDto.java similarity index 92% rename from src/main/java/com/waruru/areyouhere/session/dto/CurrentSessionResponseDto.java rename to src/main/java/com/waruru/areyouhere/session/dto/response/CurrentSessionResponseDto.java index eae212e..d7eb2ae 100644 --- a/src/main/java/com/waruru/areyouhere/session/dto/CurrentSessionResponseDto.java +++ b/src/main/java/com/waruru/areyouhere/session/dto/response/CurrentSessionResponseDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.session.dto; +package com.waruru.areyouhere.session.dto.response; import java.time.LocalDateTime; diff --git a/src/main/java/com/waruru/areyouhere/session/dto/PreviousFiveSessionResponseDto.java b/src/main/java/com/waruru/areyouhere/session/dto/response/PreviousFiveSessionResponseDto.java similarity index 91% rename from src/main/java/com/waruru/areyouhere/session/dto/PreviousFiveSessionResponseDto.java rename to src/main/java/com/waruru/areyouhere/session/dto/response/PreviousFiveSessionResponseDto.java index bf9136f..ae3e6ef 100644 --- a/src/main/java/com/waruru/areyouhere/session/dto/PreviousFiveSessionResponseDto.java +++ b/src/main/java/com/waruru/areyouhere/session/dto/response/PreviousFiveSessionResponseDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.session.dto; +package com.waruru.areyouhere.session.dto.response; import com.waruru.areyouhere.session.service.dto.SessionAttendanceInfo; import java.util.List; diff --git a/src/main/java/com/waruru/areyouhere/session/dto/RecentFiveSessionResponseDto.java b/src/main/java/com/waruru/areyouhere/session/dto/response/RecentFiveSessionResponseDto.java similarity index 87% rename from src/main/java/com/waruru/areyouhere/session/dto/RecentFiveSessionResponseDto.java rename to src/main/java/com/waruru/areyouhere/session/dto/response/RecentFiveSessionResponseDto.java index 645f4b0..d7b8e45 100644 --- a/src/main/java/com/waruru/areyouhere/session/dto/RecentFiveSessionResponseDto.java +++ b/src/main/java/com/waruru/areyouhere/session/dto/response/RecentFiveSessionResponseDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.session.dto; +package com.waruru.areyouhere.session.dto.response; import java.time.LocalDateTime; diff --git a/src/main/java/com/waruru/areyouhere/session/dto/SessionAttendeesDto.java b/src/main/java/com/waruru/areyouhere/session/dto/response/SessionAttendeesResponseDto.java similarity index 68% rename from src/main/java/com/waruru/areyouhere/session/dto/SessionAttendeesDto.java rename to src/main/java/com/waruru/areyouhere/session/dto/response/SessionAttendeesResponseDto.java index 9c8b88b..8e40036 100644 --- a/src/main/java/com/waruru/areyouhere/session/dto/SessionAttendeesDto.java +++ b/src/main/java/com/waruru/areyouhere/session/dto/response/SessionAttendeesResponseDto.java @@ -1,4 +1,4 @@ -package com.waruru.areyouhere.session.dto; +package com.waruru.areyouhere.session.dto.response; import com.waruru.areyouhere.attendee.service.dto.SessionAttendees; import java.util.List; @@ -10,12 +10,12 @@ @Data @NoArgsConstructor(access = AccessLevel.PROTECTED) -public class SessionAttendeesDto { +public class SessionAttendeesResponseDto { private List sessionAttendees; @Builder - public SessionAttendeesDto(List sessionAttendees) { + public SessionAttendeesResponseDto(List sessionAttendees) { this.sessionAttendees = sessionAttendees; } }