[WTH-499] 마이페이지 경고 횟수 추가 - #103
Hidden character warning
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| require(score > 0) { "경고 점수는 1 이상이어야 합니다." } | ||
| warningCount += score | ||
| // 경고 2회마다 패널티 1회로 자동 전환 | ||
| val converted = warningCount / WARNING_TO_PENALTY_THRESHOLD |
There was a problem hiding this comment.
if (warningCount > WARNING_TO_PENALTY_THRESHOLD) {
이 안에서 처리
}
이 방식이 더 직관적이지 않을까 싶어욤
There was a problem hiding this comment.
> 을 사용하면 경고 2회에서 전환이 안되고 3회부터 전환되어서 > 대신 >= 로 수정했습니닷!!
| val attendedSessionCount: Long, | ||
| @field:Schema(description = "패널티 횟수", example = "2") | ||
| val penaltyCount: Int, | ||
| @field:Schema(description = "경고 횟수", example = "1") |
There was a problem hiding this comment.
경고를 쓰지 않는 동아리는 response에 아예 필드를 빼주는게 좋을 것 같긴한데, 이미 db에 nullable = false로 박혀있긴 하네요
음ㅁ 한 번 고민해봐주시고, 현행유지한다면 description에 이런 내용도 같이 담아주세요
There was a problem hiding this comment.
warningEnabled = false인 동아리는 null로 내려가도록 처리해야지 프론트에서 null이면 경고 섹션을 숨기는 방식으로 활용할 수 있을 것 같아서 nullable로 변경했습니닷!! ...
| member.penaltyCount shouldBe 0 | ||
| } | ||
|
|
||
| "incrementWarningCount — 경고 3회 누적 시 패널티 1회 전환 후 경고 1회 남는다" { |
There was a problem hiding this comment.
이 방식이면 threshold가 바뀌면 테스트도 바뀌어야할 것 같네용
threshold를 이용하는 방식으로 테스트가 짜지면 더 좋을 것 같아요
There was a problem hiding this comment.
threshold 사용하는 방식으로 수정했습니닷!
📌 Summary
경고 2회 누적 시 패널티 1회로 자동 전환하고, 마이페이지 응답에 경고 횟수 필드를 추가합니다.
📝 Changes
What
GET /api/v4/clubs/{clubId}/users/me/mypage응답 stats에warningCount필드 추가Why
How
ClubMember.incrementWarningCount에서 경고 누적 후 2 이상이면warningCount -= 2,penaltyCount += 1자동 전환UserMyPageStatsResponse에warningCount필드 추가,GetUserMyPageQueryService→UserMyPageMapper까지 전달📸 Screenshots / Logs
💡 Reviewer 참고사항
incrementWarningCount(신규 경고 부여 시)에만 적용되며,adjustWarningCount(삭제·수정 시 카운트 보정)에는 적용하지 않습니다.✅ Checklist