Skip to content

Commit

Permalink
feat: add search in FaqController [#327]
Browse files Browse the repository at this point in the history
  • Loading branch information
kho903 committed Feb 13, 2022
1 parent 9f72044 commit 8ced17e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<List<FaqSearchResultDto>> SearchFaq(@RequestParam String word) {
List<FaqSearchResultDto> result = faqService.search(word);
return new Response<>(result, HttpStatus.OK);
}
}

0 comments on commit 8ced17e

Please sign in to comment.