forked from solid-connection/solid-connect-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdminMentorApplicationController.java
More file actions
37 lines (33 loc) · 1.55 KB
/
AdminMentorApplicationController.java
File metadata and controls
37 lines (33 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.example.solidconnection.admin.controller;
import com.example.solidconnection.admin.dto.MentorApplicationSearchCondition;
import com.example.solidconnection.admin.dto.MentorApplicationSearchResponse;
import com.example.solidconnection.admin.service.AdminMentorApplicationService;
import com.example.solidconnection.common.response.PageResponse;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
@RequestMapping("/admin/mentor-applications")
@RestController
@Slf4j
public class AdminMentorApplicationController {
private final AdminMentorApplicationService adminMentorApplicationService;
@GetMapping
public ResponseEntity<PageResponse<MentorApplicationSearchResponse>> searchMentorApplications(
@Valid @ModelAttribute MentorApplicationSearchCondition mentorApplicationSearchCondition,
Pageable pageable
) {
Page<MentorApplicationSearchResponse> page = adminMentorApplicationService.searchMentorApplications(
mentorApplicationSearchCondition,
pageable
);
return ResponseEntity.ok(PageResponse.of(page));
}
}