feat: 내 글/댓글 모아보기 API
- GET /board/my/posts, /board/my/comments (페이징) - PostSummary 에 category 추가, MyCommentResponse(글 제목·카테고리 포함) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
ddcd6f4335
commit
b969ba6104
@@ -36,6 +36,19 @@
|
||||
UPDATE comment SET blocked = #{blocked} WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="findMyPage" resultType="com.sb.web.board.dto.MyCommentResponse">
|
||||
SELECT c.id, c.content, c.created_at, p.id AS post_id, p.title AS post_title, p.category
|
||||
FROM comment c
|
||||
JOIN post p ON p.id = c.post_id
|
||||
WHERE c.author_id = #{memberId}
|
||||
ORDER BY c.id DESC
|
||||
LIMIT #{size} OFFSET #{offset}
|
||||
</select>
|
||||
|
||||
<select id="countMyComments" parameterType="long" resultType="long">
|
||||
SELECT COUNT(*) FROM comment WHERE author_id = #{memberId}
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.sb.web.board.domain.Comment"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO comment (post_id, author_id, author_name, content, created_at)
|
||||
|
||||
Reference in New Issue
Block a user