sej226 / spring-boot

SpringBoot 기반의 게시판 만들기
1 stars 0 forks source link

2019.06.05_ 게시글 검색 기능, 댓글 기능 구현 #8

Open sej226 opened 5 years ago

sej226 commented 5 years ago

1. 게시글 검색 기능

1) 작성자 ID로 검색 2) 게시글 제목으로 검색 3) 게시글 내용으로 검색

@RequestMapping(value = "/selectHumor/{selected}", method =  RequestMethod.GET)
   public ResponseEntity<List<Humor>> selectHumor(@PathVariable String selected) throws Exception {

      String[] select = selected.split("&");
      String[] inputStr = select[1].split("=");  
      List<Humor> humors = null;
      if(select[0].equals("ID")) {
      humors = humorService.selectHumorByID(inputStr[1]);
      System.out.println(humors);
      }else  if(select[0].equals("TITLE"))  {
          humors = humorService.selectHumorByTitle(inputStr[1]);
          System.out.println(humors);
      }else if(select[0].equals("CONTENT")) {
          humors = humorService.selectHumorByContent(inputStr[1]);
      }

      if (humors.isEmpty()) {
         return new ResponseEntity(HttpStatus.NO_CONTENT);
      }
      return new ResponseEntity<List<Humor>>(humors, HttpStatus.OK);
   }

2. 댓글 조회



![댓글 추가 결과](https://user-images.githubusercontent.com/26791027/59256998-12bb4780-8c70-11e9-8c90-6a5a3e5750cc.JPG)

# 3. 관리비
- 관리비 UI 작성
![관리비 UI](https://user-images.githubusercontent.com/26791027/59257007-15b63800-8c70-11e9-965b-666bee2694a8.JPG)

- 관리비에 생성 Page 작성

![비용 입력 폼](https://user-images.githubusercontent.com/26791027/59257015-18b12880-8c70-11e9-85a0-e27fa8668871.JPG)