1414import com .threestar .trainus .domain .lesson .admin .dto .ApplicationActionRequestDto ;
1515import com .threestar .trainus .domain .lesson .admin .dto .ApplicationProcessResponseDto ;
1616import com .threestar .trainus .domain .lesson .admin .dto .CreatedLessonListResponseDto ;
17+ import com .threestar .trainus .domain .lesson .admin .dto .CreatedLessonListWrapperDto ;
1718import com .threestar .trainus .domain .lesson .admin .dto .LessonApplicationListResponseDto ;
19+ import com .threestar .trainus .domain .lesson .admin .dto .LessonApplicationListWrapperDto ;
1820import com .threestar .trainus .domain .lesson .admin .dto .LessonCreateRequestDto ;
1921import com .threestar .trainus .domain .lesson .admin .dto .LessonResponseDto ;
2022import com .threestar .trainus .domain .lesson .admin .dto .ParticipantListResponseDto ;
23+ import com .threestar .trainus .domain .lesson .admin .dto .ParticipantListWrapperDto ;
2124import com .threestar .trainus .domain .lesson .admin .entity .ApplicationAction ;
25+ import com .threestar .trainus .domain .lesson .admin .mapper .CreatedLessonMapper ;
26+ import com .threestar .trainus .domain .lesson .admin .mapper .LessonApplicationMapper ;
27+ import com .threestar .trainus .domain .lesson .admin .mapper .LessonParticipantMapper ;
2228import com .threestar .trainus .domain .lesson .admin .service .AdminLessonService ;
2329import com .threestar .trainus .global .annotation .LoginUser ;
2430import com .threestar .trainus .global .exception .domain .ErrorCode ;
2531import com .threestar .trainus .global .exception .handler .BusinessException ;
2632import com .threestar .trainus .global .unit .BaseResponse ;
33+ import com .threestar .trainus .global .unit .PagedResponse ;
2734
2835import io .swagger .v3 .oas .annotations .Operation ;
2936import io .swagger .v3 .oas .annotations .tags .Tag ;
@@ -69,7 +76,7 @@ public ResponseEntity<BaseResponse<Void>> deleteLesson(
6976 //레슨 신청자 목록 조회
7077 @ GetMapping ("/lessons/{lessonId}/applications" )
7178 @ Operation (summary = "레슨 신청자 목록 조회 api" , description = "레슨 신청자의 목록을 조회 가능함." )
72- public ResponseEntity <BaseResponse < LessonApplicationListResponseDto >> getLessonApplications (
79+ public ResponseEntity <PagedResponse < LessonApplicationListWrapperDto >> getLessonApplications (
7380 @ PathVariable Long lessonId ,
7481 @ RequestParam (defaultValue = "1" ) @ Min (value = 1 , message = "페이지는 1 이상이어야 합니다." )
7582 @ Max (value = 1000 , message = "페이지는 1000 이하여야 합니다." ) int page ,
@@ -82,7 +89,10 @@ public ResponseEntity<BaseResponse<LessonApplicationListResponseDto>> getLessonA
8289 LessonApplicationListResponseDto responseDto = adminLessonService
8390 .getLessonApplications (lessonId , page , limit , status , loginUserId );
8491
85- return BaseResponse .ok ("레슨 신청자 목록 조회 완료." , responseDto , HttpStatus .OK );
92+ LessonApplicationListWrapperDto wrapperDto = LessonApplicationMapper
93+ .toLessonApplicationListWrapperDto (responseDto );
94+
95+ return PagedResponse .ok ("레슨 신청자 목록 조회 완료." , wrapperDto , responseDto .count (), HttpStatus .OK );
8696 }
8797
8898 //레슨 신청 승인/거절
@@ -104,7 +114,7 @@ public ResponseEntity<BaseResponse<ApplicationProcessResponseDto>> processLesson
104114 //레슨 참가자 목록 조회
105115 @ GetMapping ("/lessons/{lessonId}/participants" )
106116 @ Operation (summary = "레슨 참가자 목록 조회 api" , description = "" )
107- public ResponseEntity <BaseResponse < ParticipantListResponseDto >> getLessonParticipants (
117+ public ResponseEntity <PagedResponse < ParticipantListWrapperDto >> getLessonParticipants (
108118 @ PathVariable Long lessonId ,
109119 @ RequestParam (defaultValue = "1" ) @ Min (value = 1 , message = "페이지는 1 이상이어야 합니다." )
110120 @ Max (value = 1000 , message = "페이지는 1000 이하여야 합니다." ) int page ,
@@ -116,13 +126,16 @@ public ResponseEntity<BaseResponse<ParticipantListResponseDto>> getLessonPartici
116126 ParticipantListResponseDto responseDto = adminLessonService
117127 .getLessonParticipants (lessonId , page , limit , loginUserId );
118128
119- return BaseResponse .ok ("레슨 참가자 목록 조회 완료." , responseDto , HttpStatus .OK );
129+ ParticipantListWrapperDto wrapperDto = LessonParticipantMapper
130+ .toParticipantListWrapperDto (responseDto );
131+
132+ return PagedResponse .ok ("레슨 참가자 목록 조회 완료." , wrapperDto , responseDto .count (), HttpStatus .OK );
120133 }
121134
122135 //강사가 개설한 레슨 목록 조회
123136 @ GetMapping ("/lessons/{userId}/created-lessons" )
124137 @ Operation (summary = "강사가 개설한 레슨 목록 조회 api" , description = "" )
125- public ResponseEntity <BaseResponse < CreatedLessonListResponseDto >> getCreatedLessons (
138+ public ResponseEntity <PagedResponse < CreatedLessonListWrapperDto >> getCreatedLessons (
126139 @ PathVariable Long userId ,
127140 @ RequestParam (defaultValue = "1" ) @ Min (value = 1 , message = "페이지는 1 이상이어야 합니다." )
128141 @ Max (value = 1000 , message = "페이지는 1000 이하여야 합니다." ) int page ,
@@ -140,7 +153,10 @@ public ResponseEntity<BaseResponse<CreatedLessonListResponseDto>> getCreatedLess
140153 CreatedLessonListResponseDto responseDto = adminLessonService
141154 .getCreatedLessons (userId , page , limit , status );
142155
143- return BaseResponse .ok ("개설한 레슨 목록 조회 완료." , responseDto , HttpStatus .OK );
156+ CreatedLessonListWrapperDto wrapperDto = CreatedLessonMapper
157+ .toCreatedLessonListWrapperDto (responseDto );
158+
159+ return PagedResponse .ok ("개설한 레슨 목록 조회 완료." , wrapperDto , responseDto .count (), HttpStatus .OK );
144160 }
145161
146162}
0 commit comments