feat: 회원 탈퇴(자기 계정 삭제) — Play 정책 대응
CI / build (push) Failing after 15m7s

- DELETE /api/auth/me: 본인 계정과 모든 데이터 영구 삭제
- 게시판(글/댓글/추천/이미지)·가계부 전체·포인트·결제기록·세션 → 회원 순 삭제
- WithdrawMapper(게시판/포인트/결제/세션) + BackupMapper(가계부) 재사용
- AuthServiceTest 생성자 보강

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-06-28 16:56:23 +09:00
parent be15f5b85d
commit 8142b8b518
5 changed files with 159 additions and 1 deletions
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sb.web.auth.mapper.WithdrawMapper">
<!-- 내가 누른 표 -->
<delete id="deletePostVotesByMember">
DELETE FROM post_vote WHERE member_id = #{memberId}
</delete>
<delete id="deleteCommentVotesByMember">
DELETE FROM comment_vote WHERE member_id = #{memberId}
</delete>
<!-- 내 글에 달린 것들 -->
<delete id="deleteCommentVotesOnMyPosts">
DELETE cv FROM comment_vote cv
JOIN comment c ON c.id = cv.comment_id
JOIN post p ON p.id = c.post_id
WHERE p.author_id = #{memberId}
</delete>
<delete id="deletePostVotesOnMyPosts">
DELETE pv FROM post_vote pv
JOIN post p ON p.id = pv.post_id
WHERE p.author_id = #{memberId}
</delete>
<delete id="deletePostTagsOnMyPosts">
DELETE pt FROM post_tag pt
JOIN post p ON p.id = pt.post_id
WHERE p.author_id = #{memberId}
</delete>
<delete id="deleteCommentsOnMyPosts">
DELETE c FROM comment c
JOIN post p ON p.id = c.post_id
WHERE p.author_id = #{memberId}
</delete>
<!-- 내 댓글과 그 표 -->
<delete id="deleteCommentVotesOnMyComments">
DELETE cv FROM comment_vote cv
JOIN comment c ON c.id = cv.comment_id
WHERE c.author_id = #{memberId}
</delete>
<delete id="deleteCommentsByAuthor">
DELETE FROM comment WHERE author_id = #{memberId}
</delete>
<!-- 내 글 / 업로드 이미지 -->
<delete id="deletePostsByAuthor">
DELETE FROM post WHERE author_id = #{memberId}
</delete>
<delete id="deleteBoardImagesByMember">
DELETE FROM board_image WHERE member_id = #{memberId}
</delete>
<!-- 포인트 / 결제 / 세션 -->
<delete id="deletePointHistory">
DELETE FROM point_history WHERE member_id = #{memberId}
</delete>
<delete id="deleteIapPurchases">
DELETE FROM iap_purchase WHERE member_id = #{memberId}
</delete>
<delete id="deleteAuthSessions">
DELETE FROM auth_session WHERE member_id = #{memberId}
</delete>
</mapper>