From 8ced17e2c7db9d09888c7992d32c747f19a51a60 Mon Sep 17 00:00:00 2001 From: kho903 Date: Sun, 13 Feb 2022 22:00:52 +0900 Subject: [PATCH] feat: add search in FaqController [#327] --- .../domain/main/faq/controller/FaqController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring/src/main/java/com/bancow/bancowback/domain/main/faq/controller/FaqController.java b/spring/src/main/java/com/bancow/bancowback/domain/main/faq/controller/FaqController.java index 08471033..c63cc303 100644 --- a/spring/src/main/java/com/bancow/bancowback/domain/main/faq/controller/FaqController.java +++ b/spring/src/main/java/com/bancow/bancowback/domain/main/faq/controller/FaqController.java @@ -1,5 +1,7 @@ package com.bancow.bancowback.domain.main.faq.controller; +import java.util.List; + import javax.validation.Valid; import org.springframework.http.HttpStatus; @@ -17,7 +19,9 @@ import com.bancow.bancowback.domain.common.dto.Response; import com.bancow.bancowback.domain.main.faq.dto.FaqAddDto; import com.bancow.bancowback.domain.main.faq.dto.FaqDeleteListDto; +import com.bancow.bancowback.domain.main.faq.dto.FaqSearchResultDto; import com.bancow.bancowback.domain.main.faq.dto.FaqUpdateDto; +import com.bancow.bancowback.domain.main.faq.entity.Faq; import com.bancow.bancowback.domain.main.faq.service.FaqService; import lombok.RequiredArgsConstructor; @@ -70,4 +74,9 @@ public Response updateFaq(@RequestHeader("TOKEN") String token, @RequestBody return new Response<>(faqService.updateFaq(token, faqUpdateDto), HttpStatus.OK); } + @GetMapping("/search") + public Response> SearchFaq(@RequestParam String word) { + List result = faqService.search(word); + return new Response<>(result, HttpStatus.OK); + } }