From 6d4a9893bac2cf999343fd9e077a0f9b620e8b74 Mon Sep 17 00:00:00 2001 From: Loy-Yun Date: Thu, 22 Sep 2022 22:04:01 +0900 Subject: [PATCH 1/5] feat: add search query --- .../domain/admin/controller/AdminController.java | 15 +++++++++------ .../domain/admin/service/AdminService.java | 12 ++++++------ .../domain/question/service/QuestionService.java | 4 ++-- .../domain/user/service/UserService.java | 2 +- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java b/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java index e774518..c99f7df 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java @@ -59,25 +59,28 @@ public ResponseEntity getAdmin() { @GetMapping("/users") @Operation(summary = "회원 정보 전체 가져오기", description = "관리자에서 보여줄 유저 리스트를 조회합니다.") public ResponseEntity> getAllUsers( - @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable + @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, + @RequestParam(value = "search") String search ) { - return ResponseEntity.ok().body(adminService.getUsers(pageable)); + return ResponseEntity.ok().body(adminService.getUsers(pageable, search)); } @GetMapping("/questions") @Operation(summary = "문의사항 전체 가져오기", description = "관리자에서 보여줄 문의사항 리스트를 조회합니다.") public ResponseEntity> getAllQuestions( - @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable + @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, + @RequestParam(value = "search") String search ) { - return ResponseEntity.ok().body(adminService.getQuestions(pageable)); + return ResponseEntity.ok().body(adminService.getQuestions(pageable, search)); } @GetMapping("/sign-out") @Operation(summary = "탈퇴사유 전체 가져오기", description = "관리자에서 보여줄 탈퇴사유 리스트를 조회합니다.") public ResponseEntity> getAllSignOutReasons( - @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable + @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, + @RequestParam(value = "search") String search ) { - return ResponseEntity.ok().body(adminService.getSignOutReasons(pageable)); + return ResponseEntity.ok().body(adminService.getSignOutReasons(pageable, search)); } @GetMapping("/schedules/categories/{categoryId}") diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/admin/service/AdminService.java b/src/main/java/com/jasik/momsnaggingapi/domain/admin/service/AdminService.java index 262307e..7e51ef3 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/admin/service/AdminService.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/admin/service/AdminService.java @@ -66,8 +66,8 @@ public Admin.GradeData getGradeData() { return gradeData; } - public Page getUsers(Pageable pageable) { - Page userPage = userService.findAllUsers(pageable); + public Page getUsers(Pageable pageable, String search) { + Page userPage = userService.findAllUsers(pageable, search); Page userDataList = userPage.map(m -> User.AdminResponse.builder() .id(m.getId()) .provider(m.getProvider()) @@ -80,8 +80,8 @@ public Page getUsers(Pageable pageable) { return userDataList; } - public Page getSignOutReasons(Pageable pageable) { - Page questionPage = questionService.findAllSignOutReasons(pageable); + public Page getSignOutReasons(Pageable pageable, String search) { + Page questionPage = questionService.findAllSignOutReasons(pageable, search); return questionPage.map(q -> Question.SignOutReasonResponse.builder() .id(q.getId()) .title(q.getTitle()) @@ -90,8 +90,8 @@ public Page getSignOutReasons(Pageable pageable) .build()); } - public Page getQuestions(Pageable pageable) { - Page questionPage = questionService.findAllQuestions(pageable); + public Page getQuestions(Pageable pageable, String search) { + Page questionPage = questionService.findAllQuestions(pageable, search); return questionPage.map(q -> Question.QuestionResponse.builder() .id(q.getId()) .title(q.getTitle()) diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/question/service/QuestionService.java b/src/main/java/com/jasik/momsnaggingapi/domain/question/service/QuestionService.java index b0d224b..6191d01 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/question/service/QuestionService.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/question/service/QuestionService.java @@ -59,12 +59,12 @@ public Long countAllQuestions() { } @Transactional - public Page findAllQuestions(Pageable pageable) { + public Page findAllQuestions(Pageable pageable, String search) { return questionRepository.findAllByIsQ(true, pageable); } @Transactional - public Page findAllSignOutReasons(Pageable pageable) { + public Page findAllSignOutReasons(Pageable pageable, String search) { return questionRepository.findAllByIsQ(false, pageable); } } diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/user/service/UserService.java b/src/main/java/com/jasik/momsnaggingapi/domain/user/service/UserService.java index 0d6a167..c92cb8f 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/user/service/UserService.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/user/service/UserService.java @@ -38,7 +38,7 @@ public User.UserResponse findUser(Long id) { return modelMapper.map(user, User.UserResponse.class); } - public Page findAllUsers(Pageable pageable) { + public Page findAllUsers(Pageable pageable, String search) { return userRepository.findAll(pageable); } From 60127d716945f7052b6aa90cae0ab065c76dba5b Mon Sep 17 00:00:00 2001 From: Loy-Yun Date: Tue, 27 Sep 2022 11:32:27 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20admin=20API=20=EC=9C=A0=EC=A0=80=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../momsnaggingapi/domain/user/repository/UserRepository.java | 4 +++- .../jasik/momsnaggingapi/domain/user/service/UserService.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/user/repository/UserRepository.java b/src/main/java/com/jasik/momsnaggingapi/domain/user/repository/UserRepository.java index 978eec6..e0e37b5 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/user/repository/UserRepository.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/user/repository/UserRepository.java @@ -1,13 +1,15 @@ package com.jasik.momsnaggingapi.domain.user.repository; import com.jasik.momsnaggingapi.domain.user.User; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; -import java.awt.print.Pageable; import java.util.Optional; public interface UserRepository extends JpaRepository { Optional findByPersonalId(String personalId); Optional findByProviderCode(String ProviderCode); Optional findByProviderCodeAndProvider(String providerCode, String provider); + Page findByPersonalIdContainingIgnoreCase(String personalId, Pageable pageable); } diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/user/service/UserService.java b/src/main/java/com/jasik/momsnaggingapi/domain/user/service/UserService.java index c92cb8f..15b8132 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/user/service/UserService.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/user/service/UserService.java @@ -39,7 +39,7 @@ public User.UserResponse findUser(Long id) { } public Page findAllUsers(Pageable pageable, String search) { - return userRepository.findAll(pageable); + return userRepository.findByPersonalIdContainingIgnoreCase(search, pageable); } @Transactional From 66405cb076352b423f6190435046cb0d6e05c3e0 Mon Sep 17 00:00:00 2001 From: Loy-Yun Date: Tue, 27 Sep 2022 11:33:15 +0900 Subject: [PATCH 3/5] =?UTF-8?q?docs:=20admin=20API=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20&=20=EA=B2=80=EC=83=89=20description=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/AdminController.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java b/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java index c99f7df..61c317a 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java @@ -20,6 +20,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; +import org.springframework.data.repository.query.Param; import org.springframework.data.web.PageableDefault; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; @@ -59,8 +60,12 @@ public ResponseEntity getAdmin() { @GetMapping("/users") @Operation(summary = "회원 정보 전체 가져오기", description = "관리자에서 보여줄 유저 리스트를 조회합니다.") public ResponseEntity> getAllUsers( + @Parameter(description = "페이지 정보 \n\n page - 페이지 번호. 0부터 시작 \n\n " + + "size - default 10으로 설정. 다를 경우에만 전송 \n\n " + + "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송") @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, - @RequestParam(value = "search") String search + @Parameter(required = false, description = "검색할 아이디") + @RequestParam(value = "search", required = false) String search ) { return ResponseEntity.ok().body(adminService.getUsers(pageable, search)); } @@ -68,8 +73,12 @@ public ResponseEntity> getAllUsers( @GetMapping("/questions") @Operation(summary = "문의사항 전체 가져오기", description = "관리자에서 보여줄 문의사항 리스트를 조회합니다.") public ResponseEntity> getAllQuestions( + @Parameter(description = "페이지 정보 \n\n page - 페이지 번호. 0부터 시작 \n\n " + + "size - default 10으로 설정. 다를 경우에만 전송 \n\n " + + "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송") @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, - @RequestParam(value = "search") String search + @Parameter(required = false, description = "검색할 아이디") + @RequestParam(value = "search", required = false) String search ) { return ResponseEntity.ok().body(adminService.getQuestions(pageable, search)); } @@ -77,8 +86,12 @@ public ResponseEntity> getAllQuestions( @GetMapping("/sign-out") @Operation(summary = "탈퇴사유 전체 가져오기", description = "관리자에서 보여줄 탈퇴사유 리스트를 조회합니다.") public ResponseEntity> getAllSignOutReasons( + @Parameter(description = "페이지 정보 \n\n page - 페이지 번호. 0부터 시작 \n\n " + + "size - default 10으로 설정. 다를 경우에만 전송 \n\n " + + "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송") @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, - @RequestParam(value = "search") String search + @Parameter(required = false, description = "검색할 아이디") + @RequestParam(value = "search", required = false) String search ) { return ResponseEntity.ok().body(adminService.getSignOutReasons(pageable, search)); } From 51435b0625fb079952236fd83afcd14d9ed67427 Mon Sep 17 00:00:00 2001 From: Loy-Yun Date: Mon, 10 Oct 2022 22:02:15 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20admin=20=EB=AC=B8=EC=9D=98=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EC=A1=B0=ED=9A=8C=20API=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../momsnaggingapi/domain/admin/Admin.java | 25 +++++++++++++++++++ .../admin/controller/AdminController.java | 8 +++--- .../domain/admin/service/AdminService.java | 22 ++++++++-------- .../Interface/QuestionUserInterface.java | 9 +++++++ .../repository/QuestionRepository.java | 10 ++++++++ .../question/service/QuestionService.java | 17 +++---------- 6 files changed, 63 insertions(+), 28 deletions(-) create mode 100644 src/main/java/com/jasik/momsnaggingapi/domain/question/Interface/QuestionUserInterface.java diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/admin/Admin.java b/src/main/java/com/jasik/momsnaggingapi/domain/admin/Admin.java index 4b8b962..94fb031 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/admin/Admin.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/admin/Admin.java @@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import org.springframework.data.domain.Page; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; @@ -40,4 +41,28 @@ public static class DashBoardResponse { private ServiceData service; private GradeData grade; } + + @Schema(description = "문의 조회 시 응답 클래스") + @Getter @Setter + @Builder + @AllArgsConstructor + @NoArgsConstructor + public static class QuestionResponse { + + @Schema(description = "문의사항 id", defaultValue = "1") + private Long id; + + @Schema(description = "문의 제목", defaultValue = "문의있습니다") + private String title; + + @Schema(description = "문의 내용", defaultValue = "있었는데 없습니다.") + private String context; + + @Schema(description = "사용자 id", defaultValue = "") + private String userId; + + @Schema(description = "문의 작성 일시", defaultValue = "2022-05-08 12:00:00") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private LocalDateTime createdAt; + } } diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java b/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java index 61c317a..7cdaebf 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java @@ -72,7 +72,7 @@ public ResponseEntity> getAllUsers( @GetMapping("/questions") @Operation(summary = "문의사항 전체 가져오기", description = "관리자에서 보여줄 문의사항 리스트를 조회합니다.") - public ResponseEntity> getAllQuestions( + public ResponseEntity> getAllQuestions( @Parameter(description = "페이지 정보 \n\n page - 페이지 번호. 0부터 시작 \n\n " + "size - default 10으로 설정. 다를 경우에만 전송 \n\n " + "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송") @@ -89,11 +89,9 @@ public ResponseEntity> getAllSignOutReasons @Parameter(description = "페이지 정보 \n\n page - 페이지 번호. 0부터 시작 \n\n " + "size - default 10으로 설정. 다를 경우에만 전송 \n\n " + "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송") - @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, - @Parameter(required = false, description = "검색할 아이디") - @RequestParam(value = "search", required = false) String search + @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable ) { - return ResponseEntity.ok().body(adminService.getSignOutReasons(pageable, search)); + return ResponseEntity.ok().body(adminService.getSignOutReasons(pageable)); } @GetMapping("/schedules/categories/{categoryId}") diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/admin/service/AdminService.java b/src/main/java/com/jasik/momsnaggingapi/domain/admin/service/AdminService.java index 7e51ef3..a5c5215 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/admin/service/AdminService.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/admin/service/AdminService.java @@ -7,6 +7,7 @@ import com.jasik.momsnaggingapi.domain.push.Push; import com.jasik.momsnaggingapi.domain.push.Push.PushType; import com.jasik.momsnaggingapi.domain.push.service.PushService; +import com.jasik.momsnaggingapi.domain.question.Interface.QuestionUserInterface; import com.jasik.momsnaggingapi.domain.question.Question; import com.jasik.momsnaggingapi.domain.question.service.QuestionService; import com.jasik.momsnaggingapi.domain.schedule.Interface.ScheduleNaggingInterface; @@ -80,8 +81,8 @@ public Page getUsers(Pageable pageable, String search) { return userDataList; } - public Page getSignOutReasons(Pageable pageable, String search) { - Page questionPage = questionService.findAllSignOutReasons(pageable, search); + public Page getSignOutReasons(Pageable pageable) { + Page questionPage = questionService.findAllSignOutReasons(pageable); return questionPage.map(q -> Question.SignOutReasonResponse.builder() .id(q.getId()) .title(q.getTitle()) @@ -90,14 +91,15 @@ public Page getSignOutReasons(Pageable pageable, .build()); } - public Page getQuestions(Pageable pageable, String search) { - Page questionPage = questionService.findAllQuestions(pageable, search); - return questionPage.map(q -> Question.QuestionResponse.builder() - .id(q.getId()) - .title(q.getTitle()) - .context(q.getContext()) - .createdAt(q.getCreatedAt()) - .userId(q.getUserId()) // TODO: userId -> personalId 값으로 변경 + public Page getQuestions(Pageable pageable, String search) { + Page questionPage = questionService.findAllQuestions(pageable, search); + + return questionPage.map(q -> Admin.QuestionResponse.builder() + .id(q.getQuestion().getId()) + .title(q.getQuestion().getTitle()) + .context(q.getQuestion().getContext()) + .createdAt(q.getQuestion().getCreatedAt()) + .userId(q.getUser().getPersonalId()) .build()); } diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/question/Interface/QuestionUserInterface.java b/src/main/java/com/jasik/momsnaggingapi/domain/question/Interface/QuestionUserInterface.java new file mode 100644 index 0000000..ba5bfda --- /dev/null +++ b/src/main/java/com/jasik/momsnaggingapi/domain/question/Interface/QuestionUserInterface.java @@ -0,0 +1,9 @@ +package com.jasik.momsnaggingapi.domain.question.Interface; + +import com.jasik.momsnaggingapi.domain.question.Question; +import com.jasik.momsnaggingapi.domain.user.User; + +public interface QuestionUserInterface { + Question getQuestion(); + User getUser(); +} diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/question/repository/QuestionRepository.java b/src/main/java/com/jasik/momsnaggingapi/domain/question/repository/QuestionRepository.java index 36abe2f..dea55e9 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/question/repository/QuestionRepository.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/question/repository/QuestionRepository.java @@ -1,13 +1,23 @@ package com.jasik.momsnaggingapi.domain.question.repository; +import com.jasik.momsnaggingapi.domain.question.Interface.QuestionUserInterface; import com.jasik.momsnaggingapi.domain.question.Question; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.transaction.annotation.Transactional; import java.util.List; public interface QuestionRepository extends JpaRepository { + @Transactional + @Query("select q as question, u as user from Question q inner join User u " + + "on q.userId = u.id " + + "where (:personalId is null or u.personalId LIKE %:personalId%) and q.isQ = :isQ") + Page findAllQuestions(@Param("personalId") String personalId, @Param("isQ") boolean isQ, Pageable pageable); + Page findAllByIsQ(boolean isQ, Pageable pageable); Long countByIsQ(boolean isQ); diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/question/service/QuestionService.java b/src/main/java/com/jasik/momsnaggingapi/domain/question/service/QuestionService.java index 6191d01..2bead31 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/question/service/QuestionService.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/question/service/QuestionService.java @@ -1,19 +1,10 @@ package com.jasik.momsnaggingapi.domain.question.service; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.jasik.momsnaggingapi.domain.diary.Diary; -import com.jasik.momsnaggingapi.domain.diary.Diary.DiaryResponse; +import com.jasik.momsnaggingapi.domain.question.Interface.QuestionUserInterface; import com.jasik.momsnaggingapi.domain.question.Question; -import com.jasik.momsnaggingapi.domain.question.Question.QuestionResponse; import com.jasik.momsnaggingapi.domain.question.repository.QuestionRepository; -import com.jasik.momsnaggingapi.domain.schedule.Schedule; -import java.time.LocalDate; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import com.jasik.momsnaggingapi.domain.user.User; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.modelmapper.ModelMapper; @@ -59,12 +50,12 @@ public Long countAllQuestions() { } @Transactional - public Page findAllQuestions(Pageable pageable, String search) { - return questionRepository.findAllByIsQ(true, pageable); + public Page findAllQuestions(Pageable pageable, String search) { + return questionRepository.findAllQuestions(search, true, pageable); } @Transactional - public Page findAllSignOutReasons(Pageable pageable, String search) { + public Page findAllSignOutReasons(Pageable pageable) { return questionRepository.findAllByIsQ(false, pageable); } } From 3988ec21517c280bf328c5e3fd3a3763c393ffe8 Mon Sep 17 00:00:00 2001 From: Loy-Yun Date: Mon, 10 Oct 2022 22:29:28 +0900 Subject: [PATCH 5/5] =?UTF-8?q?feat:=20admin=20pagination=20sort=20swagger?= =?UTF-8?q?=20=EC=84=A4=EB=AA=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/admin/controller/AdminController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java b/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java index 7cdaebf..f7145ed 100644 --- a/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java +++ b/src/main/java/com/jasik/momsnaggingapi/domain/admin/controller/AdminController.java @@ -62,7 +62,8 @@ public ResponseEntity getAdmin() { public ResponseEntity> getAllUsers( @Parameter(description = "페이지 정보 \n\n page - 페이지 번호. 0부터 시작 \n\n " + "size - default 10으로 설정. 다를 경우에만 전송 \n\n " + - "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송") + "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송" + + "(ex. a 칼럼으로 오름차순 정렬 - [\"a\"], 내림차순 정렬 - [\"a,DESC\"]") @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, @Parameter(required = false, description = "검색할 아이디") @RequestParam(value = "search", required = false) String search @@ -75,7 +76,8 @@ public ResponseEntity> getAllUsers( public ResponseEntity> getAllQuestions( @Parameter(description = "페이지 정보 \n\n page - 페이지 번호. 0부터 시작 \n\n " + "size - default 10으로 설정. 다를 경우에만 전송 \n\n " + - "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송") + "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송" + + "(ex. a 칼럼으로 오름차순 정렬 - [\"a\"], 내림차순 정렬 - [\"a,DESC\"]") @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable, @Parameter(required = false, description = "검색할 아이디") @RequestParam(value = "search", required = false) String search @@ -88,7 +90,8 @@ public ResponseEntity> getAllQuestions( public ResponseEntity> getAllSignOutReasons( @Parameter(description = "페이지 정보 \n\n page - 페이지 번호. 0부터 시작 \n\n " + "size - default 10으로 설정. 다를 경우에만 전송 \n\n " + - "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송") + "sort - 해당 칼럼 오름차순 정렬. default id 이므로 다를 경우에만 전송 " + + "(ex. a 칼럼으로 오름차순 정렬 - [\"a\"], 내림차순 정렬 - [\"a,DESC\"])") @PageableDefault(size=10, sort="id", direction = Sort.Direction.ASC) Pageable pageable ) { return ResponseEntity.ok().body(adminService.getSignOutReasons(pageable));