1 댓글 목록 불러오기
GET /comment/{boardId}
2021-10-01 (Springboot - comment테이블 - 댓글 목록 불러오기 ) (tistory.com)
2021-10-01 (Springboot - comment테이블 - 댓글 목록 불러오기 )
1. (Mission 수행)Comment 테이블 댓글 목록을 불러오자 Comment 테이블을 추가한 구조 CommentController.java @GetMapping(value = "/{id}") public ApiResponse getCommentList(@PathVariable int id) { List..
bsy-96.tistory.com
2-1 글에 딸린 댓글 목록 불러오기
GET /board/{id} 를 고쳐서.
아래 방식으로 나오도록
{
…
“data”: {
“id” : 1,
“author” : “author”,
….,
“comments” : [
{
“id”: 1,
“author” : “commentAuthor“,
….
},
{ … }, …
]
}
}
2021-10-07 (Springboot - board테이블 - 글읽기 수정 ) (tistory.com)
2021-10-07 (Springboot - board테이블 - 글읽기 수정 )
1. (Mission 수행) 글을 읽었을 때 글과 댓글이 같이 보이도록 @AllArgsConstructor 모든 필드에 대한 생성자 생성 @RequiredArgsConstructor 초기화 되지 않은 final 필드와 @NonNull 어노테이션이 붙은 필드에..
bsy-96.tistory.com
2-2 글 읽기 비즈니스 로직 추가
isDel = “Y“ 이면 아래 json response 나오도록
{
“success”: false,
“message”: “board id {id} is already deleted.”
“data”: null
}
2021-10-07 (Springboot - board테이블 - 글읽기 수정 ) (tistory.com)
2021-10-07 (Springboot - board테이블 - 글읽기 수정 )
1. (Mission 수행) 글을 읽었을 때 isDel="Y"이면 삭제된 글이라는 메세지 나오도록 BoardDTO.java - 삭제여부를 확인하는 isDel 값을 가져오는 코드 추가 private String isDel; // 삭제 여부 확인 BoardService...
bsy-96.tistory.com
3-1 댓글 쓰기
POST /comment/
성공 시 json response 아래처럼 나오도록
{
“success”: true,
“message”: “success to post comment in board id {id}”
}
2021-10-05 (Springboot - comment테이블 - 댓글 쓰기 )
1. (Mission 수행)Comment 테이블 댓글 써보자 CommentController.java //3 댓글 쓰기 //POST /comment/ //성공 시 json response 아래처럼 나오도록 //{ //“success”: true, //“message”: “success to post..
bsy-96.tistory.com
3-2 댓글 기능 수정
POST /comment/
Board테이블에 없는 id값이 들어가면 아래와 같은 json response 보여주도록
{
"success": false,
"message": ”id value is not exists in board”,
"data": null
}
2021-10-06 (Springboot - comment테이블 - 댓글 쓰기 수정)
1. (Mission 수행)Comment 테이블 댓글을 쓸 때 Board 테이블에 없는 id일 경우 메세지를 출력하도록 - 먼저 만든 댓글 기능을 수정 https://bsy-96.tistory.com/65 2021-10-05 (Springboot - comment테이블 - 댓..
bsy-96.tistory.com
4 글 수정 기능: 패스워드 일치하면 수정 되도록
PUT /board/{id} 고쳐서.
패스워드 일치: json response 아래처럼 나오도록
{
“success”: true,
“message”: “success to update board id {id}”
}
패스워드 일치하지 않으면
아래 json response 나오도록
{
“success”: false,
“message”: “password incorrect in board id {id}”
“data”: null
}
2021-10-05 (Springboot - Board테이블 - 글수정기능(패스워드 일치) )
1. (Mission 수행)기존 Board 테이블 글 수정 기능에 패스워드 일치시 가능하게하자 BoardController.java //4 글 수정 기능: 패스워드 일치하면 수정 되도록 /* PUT /board/{id} 고쳐서. 패스워드 일치: json res..
bsy-96.tistory.com
5 글 삭제 기능: 패스워드 일치하면 삭제처리 되도록
DELETE /board/{id} 고쳐서.
isDel 컬럼을 업데이트하는
비즈니스 로직은 그대로 가져감.
패스워드 일치: json response 아래처럼 나오도록
{
“success”: true,
“message”: “success to delete board id {id}”
}
패스워드 일치하지 않으면
아래 json response 나오도록
{
“success”: false,
“message”: “password incorrect in board id {id}”
“data”: null
}
2021-10-05 (Springboot - Board테이블 - 글삭제기능(패스워드 일치) )
1. (Mission 수행)기존 Board 테이블 글 삭제 기능에 패스워드 일치시 삭제가능하게 하자 BoardController.java //5 글 삭제 기능: 패스워드 일치하면 삭제처리 되도록 /* DELETE /board/{id} 고쳐서. isDel 컬럼..
bsy-96.tistory.com
6 글 전체 보기 수정
GET /board/
isDel = ‘Y’ 인 아이들만 보이도록
2021-10-05 (Springboot - Board테이블 - 글 전체보기 수정 )
1. (Mission 수행) isDel = ‘Y’ 인 아이들만 보이도록 - BoardMapper.xml에 isDel 값이 "N"일 때 select하도록 수정 https://bsy-96.tistory.com/56 2021-09-28 (Springboot - board 테이블 연결) 1. 지금까지..
bsy-96.tistory.com
'Springboot' 카테고리의 다른 글
2021-10-05 (Springboot - comment테이블 - 댓글 쓰기 ) (0) | 2021.10.05 |
---|---|
2021-10-01 (Springboot - comment테이블 - 댓글 목록 불러오기 ) (0) | 2021.10.01 |
2021-10-01 (Springboot - board 테이블 delete 리뷰) (0) | 2021.10.01 |
2021-10-01 (Springboot - board 테이블 read) (0) | 2021.10.01 |
2021-09-30 (Springboot - board 테이블 insert) (0) | 2021.09.30 |