삭제 기능은 여태까지 따라 왔다면 크게 어려울 것이 없습니다.
PostService
삭제하는 방식은 id를 기준으로 posts 객체를 받고
postsRepository.delete(Posts객체) 이렇게 하면 됩니다.
PostsApiController
마찬가지로 DeleteMapping으로 컨트롤러를 작성해줍니다.
테스트를 돌려보면 성공 !
'SpringBoot' 카테고리의 다른 글
SpringBoot With JPA 게시판 만들기 - 06 머스태치 (0) | 2020.06.23 |
---|---|
SpringBoot With JPA 게시판 만들기 - 04 업데이트 기능 (0) | 2020.06.21 |
SpringBoot With JPA 게시판 만들기 - 03 글쓰기 기능 (2) | 2020.06.18 |
SpringBoot With JPA 게시판 만들기 - 02 엔티티 설정 (0) | 2020.06.16 |
SpringBoot With JPA 게시판 만들기 - 01 개발환경 세팅 (0) | 2020.06.15 |