- 작성자 아바타: post/comment 조회 시 member JOIN(google_picture/profile_image),
목록·상세·댓글 응답에 노출
- 추천/비추천: post_vote/comment_vote 테이블 + 토글 API
(POST /board/posts|comments/{id}/vote), 게시글/댓글 응답에 up/down/myVote
- 추천자 목록: GET /board/posts/{id}/recommenders + PostDetail.recommenders
- 포인트: member.points + point_history. 글/댓글 작성 시 10P, 하루 3회 한도(합산).
PointService, GET /auth/points, MemberResponse.points 노출
- @MapperScan 에 point.mapper 추가, AuthController WebMvc 테스트 MockBean 보강
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?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.point.mapper.PointMapper">
|
||||
|
||||
<select id="countTodayGrants" resultType="int">
|
||||
SELECT COUNT(*) FROM point_history
|
||||
WHERE member_id = #{memberId} AND reason = #{reason} AND created_at >= CURDATE()
|
||||
</select>
|
||||
|
||||
<insert id="insertHistory">
|
||||
INSERT INTO point_history (member_id, amount, reason, created_at)
|
||||
VALUES (#{memberId}, #{amount}, #{reason}, NOW())
|
||||
</insert>
|
||||
|
||||
<update id="addPoints">
|
||||
UPDATE member SET points = points + #{amount}, updated_at = NOW() WHERE id = #{memberId}
|
||||
</update>
|
||||
|
||||
<select id="getPoints" parameterType="long" resultType="long">
|
||||
SELECT points FROM member WHERE id = #{memberId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user