(Integer bno)
| 88 | |
| 89 | // 지정된 게시물의 모든 댓글을 가져오는 메서드 |
| 90 | @GetMapping("/comments") // /comments?bno=1080 GET |
| 91 | public ResponseEntity<List<CommentDto>> list(Integer bno) { |
| 92 | List<CommentDto> list = null; |
| 93 | try { |
| 94 | list = service.getList(bno); |
| 95 | return new ResponseEntity<List<CommentDto>>(list, HttpStatus.OK); // 200 |
| 96 | } catch (Exception e) { |
| 97 | e.printStackTrace(); |
| 98 | return new ResponseEntity<List<CommentDto>>(HttpStatus.BAD_REQUEST); // 400 |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | |
| 103 | } |