diff --git a/src/main/java/com/waruru/areyouhere/attendee/domain/repository/AttendeeRepository.java b/src/main/java/com/waruru/areyouhere/attendee/domain/repository/AttendeeRepository.java index b0f15b0..63c6d59 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/domain/repository/AttendeeRepository.java +++ b/src/main/java/com/waruru/areyouhere/attendee/domain/repository/AttendeeRepository.java @@ -13,14 +13,14 @@ public interface AttendeeRepository extends JpaRepository { @Query(value = "SELECT * FROM attendee WHERE attendee.course_id = :courseId And attendee.id NOT IN (SELECT att.attendee_id FROM attendance as att WHERE att.session_id = :sessionId)", nativeQuery = true) public List findAbsenteeBySessionIdWhenNoRegister(@Param("courseId") Long courseId, @Param("sessionId") Long sessionId); - @Query(value = "SELECT atdee.name as AttendeeName, atda.is_attended as AttendanceStatus, atda.created_at as AttendanceTime \n" + @Query(value = "SELECT atdee.id as attendeeId, atdee.name as AttendeeName, atda.is_attended as AttendanceStatus, atda.created_at as AttendanceTime \n" + "FROM attendee as atdee \n" + "INNER JOIN attendance as atda ON atdee.id = atda.attendee_id \n" + "WHERE atda.session_id = :sessionId", nativeQuery = true) public List findSessionAttendees(@Param("sessionId") Long sessionId); - @Query(value = "SELECT atdee.name as AttendeeName, atda.is_attended as AttendanceStatus, atda.created_at as AttendanceTime \n" + @Query(value = "SELECT atdee.id as attendeeId,atdee.name as AttendeeName, atda.is_attended as AttendanceStatus, atda.created_at as AttendanceTime \n" + "FROM attendee as atdee \n" + "INNER JOIN attendance as atda ON atdee.id = atda.attendee_id \n" + "WHERE atda.session_id = :sessionId \n" diff --git a/src/main/java/com/waruru/areyouhere/attendee/domain/repository/dto/SessionAttendeeInfo.java b/src/main/java/com/waruru/areyouhere/attendee/domain/repository/dto/SessionAttendeeInfo.java index b7f5005..2949024 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/domain/repository/dto/SessionAttendeeInfo.java +++ b/src/main/java/com/waruru/areyouhere/attendee/domain/repository/dto/SessionAttendeeInfo.java @@ -3,6 +3,8 @@ import java.time.LocalDateTime; public interface SessionAttendeeInfo { + + public Long getAttendeeId(); public String getAttendeeName(); public Boolean getAttendanceStatus(); 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 f86308f..0bac932 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeServiceImpl.java +++ b/src/main/java/com/waruru/areyouhere/attendee/service/AttendeeServiceImpl.java @@ -57,6 +57,7 @@ public List getSessionAttendeesIfExistsOrEmpty(Long sessionId) return sessionAttendees == null || sessionAttendees.isEmpty() ? Collections.emptyList() : sessionAttendees.stream().map(sessionAttendee -> SessionAttendees.builder() + .id(sessionAttendee.getAttendeeId()) .attendeeName(sessionAttendee.getAttendeeName()) .attendanceStatus(sessionAttendee.getAttendanceStatus()) .attendanceTime(sessionAttendee.getAttendanceTime()) @@ -69,6 +70,7 @@ public List getSessionAbsenteesIfExistsOrEmpty(Long sessionId) return sessionAttendees == null || sessionAttendees.isEmpty() ? Collections.emptyList() : sessionAttendees.stream().map(sessionAttendee -> SessionAttendees.builder() + .id(sessionAttendee.getAttendeeId()) .attendeeName(sessionAttendee.getAttendeeName()) .attendanceStatus(sessionAttendee.getAttendanceStatus()) .attendanceTime(sessionAttendee.getAttendanceTime()) diff --git a/src/main/java/com/waruru/areyouhere/attendee/service/dto/SessionAttendees.java b/src/main/java/com/waruru/areyouhere/attendee/service/dto/SessionAttendees.java index 127cd5e..9a0634c 100644 --- a/src/main/java/com/waruru/areyouhere/attendee/service/dto/SessionAttendees.java +++ b/src/main/java/com/waruru/areyouhere/attendee/service/dto/SessionAttendees.java @@ -10,6 +10,8 @@ @Getter public class SessionAttendees { + private Long id; + private String attendeeName; private boolean attendanceStatus; @@ -18,7 +20,8 @@ public class SessionAttendees { @Builder - public SessionAttendees(String attendeeName, boolean attendanceStatus, LocalDateTime attendanceTime) { + public SessionAttendees(Long id, String attendeeName, boolean attendanceStatus, LocalDateTime attendanceTime) { + this.id = id; this.attendeeName = attendeeName; this.attendanceStatus = attendanceStatus; this.attendanceTime = attendanceTime; diff --git a/src/main/java/com/waruru/areyouhere/auth/interceptor/LoginInterceptor.java b/src/main/java/com/waruru/areyouhere/auth/interceptor/LoginInterceptor.java index 20fa850..3f3383a 100644 --- a/src/main/java/com/waruru/areyouhere/auth/interceptor/LoginInterceptor.java +++ b/src/main/java/com/waruru/areyouhere/auth/interceptor/LoginInterceptor.java @@ -28,8 +28,6 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons try { Manager manager = managerService.getLoginUser(); } catch (UnAuthenticatedException e) { - request.setAttribute("message", "로그인이 필요합니다."); - request.setAttribute("exception", "UnAuthenticatedException"); request.getRequestDispatcher("/api/manager/unauthorized").forward(request, response); return false; }