Files
sb-backend/src/main/resources/mapper/WithdrawMapper.xml
T
ByungCheolandClaude Opus 4.8 ba75613e1c feat: 게시판 신고 — 누적 5건 시 블라인드(관리자만 열람)
- report 테이블(회원당 대상별 1회), comment.blocked 컬럼
- POST /board/posts|comments/{id}/report, 본인 글/댓글 신고 불가
- 글: 5건이면 blocked(기존 열람제한 재사용) / 댓글: blocked → 비관리자 본문 숨김
- 삭제·탈퇴 시 신고 정리

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 18:05:10 +09:00

70 lines
2.3 KiB
XML

<?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="deleteReportsByMember">
DELETE FROM report 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>