feat: 실시간 페이스 코치 기능 구현#151
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ 연관 이슈
개요
러닝 중 실시간으로 페이스를 체크하여 평균보다 느릴 때 사용자에게 알림을 제공하는 기능을 구현했습니다.
구현 목적
주요 기능
변경 사항
1. Entity 수정
isPaceCoachEnabled필드 추가 (Boolean, 기본값: false)2. DTO 수정/생성
UserUpdateRequest.java
isPaceCoachEnabled필드 추가PaceCoachCheckRequest.java (신규)
sessionId,currentKm,currentPaceSecondsPaceCoachCheckResponse.java (신규)
shouldAlert), 페이스 비교 결과 포함3. Service 구현
4. Controller 구현
POST /v1/running/pace-coach/check🔌 API 스펙
엔드포인트
POST /v1/running/pace-coach/check
Request
Response (페이스 느림)
Response (페이스 괜찮음)
Response (5회 미만)
동작 플로우
↓
↓
↓
↓
↓
↓
🧪 테스트 방법
User의 isPaceCoachEnabled = false 상태에서
POST /v1/running/pace-coach/check
{
"session_id": "test-session",
"current_km": 1,
"current_pace_seconds": 360
}
예상 결과: coach_enabled: false
완료된 러닝 기록이 3회인 사용자
POST /v1/running/pace-coach/check
예상 결과: is_available: false, current_records: 3
완료된 러닝 5회 이상, 평균 360초/km
POST /v1/running/pace-coach/check
예상 결과: should_alert: true, difference_seconds: 20
완료된 러닝 5회 이상, 평균 360초/km
예상 결과: should_alert: false, difference_seconds: -10
📁 변경된 파일
수정
신규
✅ 체크리스트
💡 주요 구현 포인트
📌 참고사항
🚀 배포 시 주의사항
ALTER TABLE users ADD COLUMN is_pace_coach_enabled TINYINT(1) NOT NULL DEFAULT 0;