Hello

10_회원 삭제하기

by 볼빵빵오춘기

list.html

<a th:href="@{|/member/delete/${member.id}|}">삭제</a>

 

MemberController

    @GetMapping("/member/delete/{id}")
    public String deleteById(@PathVariable Long id){
        memberService.delete(id);
        return "redirect:/member/";
    }

 

MemberSerivce

    public void delete(Long id) {
        memberRepository.deleteById(id);
    }

 

블로그의 정보

Hello 춘기's world

볼빵빵오춘기

활동하기