Skip to content

[WTH-499] 마이페이지 경고 횟수 추가 - #103

Merged
woneeeee merged 6 commits into
devfrom
fix/WTH-499-마이페이지-경고-횟수-추가
Sep 11, 2026

Hidden character warning

The head ref may contain hidden characters: "fix/WTH-499-\ub9c8\uc774\ud398\uc774\uc9c0-\uacbd\uace0-\ud69f\uc218-\ucd94\uac00"
Merged

woneeeee merged 6 commits into
devfrom
fix/WTH-499-마이페이지-경고-횟수-추가

Conversation

@woneeeee

@woneeeee woneeeee commented Sep 9, 2026

Copy link
Copy Markdown
Member

📌 Summary

어떤 작업인지 한 줄 요약해 주세요.

경고 2회 누적 시 패널티 1회로 자동 전환하고, 마이페이지 응답에 경고 횟수 필드를 추가합니다.

📝 Changes

변경사항을 what, why, how로 구분해 작성해 주세요.

What

  • 경고 2회 누적 시 패널티 1회로 자동 전환
  • GET /api/v4/clubs/{clubId}/users/me/mypage 응답 stats에 warningCount 필드 추가

Why

  • 경고와 패널티가 별도로 관리되어 경고 누적에 따른 자동 제재가 없었음
  • 마이페이지에서 경고 횟수를 확인할 수 없어 프론트 렌더링 불가

How

  • ClubMember.incrementWarningCount에서 경고 누적 후 2 이상이면 warningCount -= 2, penaltyCount += 1 자동 전환
  • UserMyPageStatsResponsewarningCount 필드 추가, GetUserMyPageQueryServiceUserMyPageMapper까지 전달

📸 Screenshots / Logs

필요시 스크린샷 or 로그를 첨부해주세요.

💡 Reviewer 참고사항

리뷰에 참고할 내용을 작성해주세요.

  • 자동 전환은 incrementWarningCount(신규 경고 부여 시)에만 적용되며, adjustWarningCount(삭제·수정 시 카운트 보정)에는 적용하지 않습니다.
  • 경고 2회가 동시에 부여될 경우(score=2)에도 올바르게 전환됩니다.

✅ Checklist

  • PR 제목 설정 완료 (WTH-123 인증 필터 설정)
  • 테스트 구현 완료
  • 리뷰어 등록 완료
  • 자체 코드 리뷰 완료

@woneeeee
woneeeee requested review from hyxklee and soo0711 September 9, 2026 09:01
@woneeeee woneeeee self-assigned this Sep 9, 2026
@woneeeee woneeeee added the 📬 API 서버 API 통신 label Sep 9, 2026
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2ff4479e-9b7b-4887-81a4-a74a9f8dbba3


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

require(score > 0) { "경고 점수는 1 이상이어야 합니다." }
warningCount += score
// 경고 2회마다 패널티 1회로 자동 전환
val converted = warningCount / WARNING_TO_PENALTY_THRESHOLD

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (warningCount > WARNING_TO_PENALTY_THRESHOLD) {
이 안에서 처리
}

이 방식이 더 직관적이지 않을까 싶어욤

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> 을 사용하면 경고 2회에서 전환이 안되고 3회부터 전환되어서 > 대신 >= 로 수정했습니닷!!

val attendedSessionCount: Long,
@field:Schema(description = "패널티 횟수", example = "2")
val penaltyCount: Int,
@field:Schema(description = "경고 횟수", example = "1")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경고를 쓰지 않는 동아리는 response에 아예 필드를 빼주는게 좋을 것 같긴한데, 이미 db에 nullable = false로 박혀있긴 하네요
음ㅁ 한 번 고민해봐주시고, 현행유지한다면 description에 이런 내용도 같이 담아주세요

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warningEnabled = false인 동아리는 null로 내려가도록 처리해야지 프론트에서 null이면 경고 섹션을 숨기는 방식으로 활용할 수 있을 것 같아서 nullable로 변경했습니닷!! ...

member.penaltyCount shouldBe 0
}

"incrementWarningCount — 경고 3회 누적 시 패널티 1회 전환 후 경고 1회 남는다" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 방식이면 threshold가 바뀌면 테스트도 바뀌어야할 것 같네용
threshold를 이용하는 방식으로 테스트가 짜지면 더 좋을 것 같아요

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

threshold 사용하는 방식으로 수정했습니닷!

@woneeeee
woneeeee requested a review from hyxklee September 11, 2026 11:13
@woneeeee
woneeeee merged commit 1420ae6 into dev Sep 11, 2026
2 checks passed
@woneeeee
woneeeee deleted the fix/WTH-499-마이페이지-경고-횟수-추가 branch September 11, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📬 API 서버 API 통신

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants