Skip to content

feat: 온도 업데이트 메서드 구현 완료#73

Merged
oxomi merged 3 commits intomainfrom
feature/ondo
Jul 30, 2025
Merged

feat: 온도 업데이트 메서드 구현 완료#73
oxomi merged 3 commits intomainfrom
feature/ondo

Conversation

@oxomi
Copy link
Copy Markdown
Collaborator

@oxomi oxomi commented Jul 30, 2025

Summary by CodeRabbit

  • 신규 기능

    • 통증 및 운동 기록 추가 시 가족 정보를 반영하고, 해당 활동에 따라 가족 온도가 증가합니다.
    • 부모의 통증/운동 기록을 자녀가 조회할 때도 가족 온도가 증가합니다.
    • 하루 1회 한정으로 다양한 가족 활동(감정 등록, 통증/운동/약 복용 입력/조회)에 따라 온도가 자동으로 증가합니다.
    • 가족 전체가 감정을 등록하거나 목표 걸음 수 달성 시 보너스 온도가 지급됩니다.
    • 일정 기간 가족 활동이 없을 경우 자동으로 온도가 감소합니다.
  • API 변경

    • 통증 및 운동 기록 추가 API가 요청 본문으로 데이터를 받도록 변경되었습니다.
    • 통증 및 운동 기록 조회 시 인증 정보가 반영됩니다.
    • 일부 엔드포인트 경로가 변경되었습니다.
  • 버그 수정 및 개선

    • 가족 온도 기여도 조회 시 사용자명이 표시됩니다.
  • 테스트

    • 통증/운동 기록 및 온도 컨트롤러 관련 테스트 코드가 삭제되었습니다.

oxomi added 3 commits July 28, 2025 23:18
feat: 통증 부위, 운동 시간 기록&조회 API에 온도 상승 메서드 적용
feat: 온도 하락 메서드 스케줄러로 구현
feat: 통증, 운동 API 수정 및 테스트 완료
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 30, 2025

Walkthrough

이번 변경에서는 건강 기록 컨트롤러의 엔드포인트가 리퀘스트 바디 기반으로 개편되고, 가족 및 온도 관련 부가 로직이 추가되었습니다. 온도 서비스에 다양한 온도 증가·감소 및 보너스/패널티 스케줄러가 구현되었으며, 관련 DTO·엔티티·레포지토리도 확장되었습니다. 기존 테스트 코드들은 삭제되었습니다.

Changes

Cohort / File(s) Change Summary
HealthRecordController 및 서비스 연동
.../controller/HealthRecordController.java, .../service/HealthRecordService.java
컨트롤러의 기록 추가 API가 리퀘스트 바디로 전환되고, 가족 정보 및 온도 서비스 호출이 추가됨. 기록 조회 시에도 가족 및 온도 연동. 서비스 메서드명 일부 변경.
요청 DTO 신설
.../dto/ExerciseRecordRequest.java, .../dto/PainRecordRequest.java
운동/통증 기록 요청용 불변 DTO(Java record) 신설.
온도 서비스 및 레포지토리 확장
.../service/TemperatureService.java, .../repository/TemperatureRepository.java, .../entity/Temperature.java
온도 증가/감소 로직 및 일일 스케줄러 구현, 이유(reason) 필드 추가, 존재 여부 쿼리 메서드 추가.
온도 기여 DTO 변경
.../dto/FamilyTemperatureContributionResponse.java
기여자 식별 필드가 userId(UUID)에서 userName(String)으로 변경됨.
테스트 코드 제거
.../test/java/ongi/HealthRecordControllerTest.java, .../test/java/ongi/TemperatureControllerUnitTest.java
컨트롤러 및 온도 관련 단위 테스트 전체 삭제.

Sequence Diagram(s)

sequenceDiagram
    participant 사용자
    participant HealthRecordController
    participant FamilyService
    participant HealthRecordService
    participant TemperatureService

    사용자->>HealthRecordController: 통증/운동 기록 추가 요청 (RequestBody)
    HealthRecordController->>FamilyService: 가족 정보 조회
    FamilyService-->>HealthRecordController: 가족 ID 반환
    HealthRecordController->>HealthRecordService: 기록 추가
    HealthRecordService-->>HealthRecordController: 기록 응답
    HealthRecordController->>TemperatureService: 온도 증가 (활동별 reason)
    TemperatureService-->>HealthRecordController: 완료
    HealthRecordController-->>사용자: 기록 응답 반환
Loading
sequenceDiagram
    participant Scheduler
    participant TemperatureService
    participant FamilyRepository
    participant TemperatureRepository

    Scheduler->>TemperatureService: 매일 23:59:59 보너스/패널티 처리
    TemperatureService->>FamilyRepository: 전체 가족 목록 조회
    FamilyRepository-->>TemperatureService: 가족 목록 반환
    loop 각 가족별
        TemperatureService->>TemperatureRepository: 오늘 활동 기록 확인
        TemperatureRepository-->>TemperatureService: 결과 반환
        alt 보너스 조건 충족
            TemperatureService->>TemperatureRepository: 보너스 온도 증가 기록
        else 패널티 조건 충족
            TemperatureService->>TemperatureRepository: 온도 감소 기록
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Poem

🥕
오늘도 코드밭을 누비는 토끼,
온도 오르고 가족 웃음이 번진다네!
리퀘스트 바디로 기록을 쏙,
보너스와 패널티, 스케줄러도 똑똑.
테스트는 잠시 굿바이,
새로워진 온기, 함께 뛰놀자!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 60cfe5a and 69659e8.

📒 Files selected for processing (10)
  • backend/ongi/src/main/java/ongi/health/controller/HealthRecordController.java (2 hunks)
  • backend/ongi/src/main/java/ongi/health/dto/ExerciseRecordRequest.java (1 hunks)
  • backend/ongi/src/main/java/ongi/health/dto/PainRecordRequest.java (1 hunks)
  • backend/ongi/src/main/java/ongi/health/service/HealthRecordService.java (1 hunks)
  • backend/ongi/src/main/java/ongi/temperature/dto/FamilyTemperatureContributionResponse.java (1 hunks)
  • backend/ongi/src/main/java/ongi/temperature/entity/Temperature.java (1 hunks)
  • backend/ongi/src/main/java/ongi/temperature/repository/TemperatureRepository.java (1 hunks)
  • backend/ongi/src/main/java/ongi/temperature/service/TemperatureService.java (3 hunks)
  • backend/ongi/src/test/java/ongi/HealthRecordControllerTest.java (0 hunks)
  • backend/ongi/src/test/java/ongi/TemperatureControllerUnitTest.java (0 hunks)
💤 Files with no reviewable changes (2)
  • backend/ongi/src/test/java/ongi/TemperatureControllerUnitTest.java
  • backend/ongi/src/test/java/ongi/HealthRecordControllerTest.java

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Join our Discord community for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@oxomi oxomi changed the title feat: 통증부위, 운동시간 기록&조회 API 테스트 완료 feat: 온도 업데이트 메서드 구현 완료 Jul 30, 2025
@oxomi oxomi merged commit eba821a into main Jul 30, 2025
4 checks passed
@oxomi oxomi deleted the feature/ondo branch July 30, 2025 15:19
Neibce pushed a commit to 2025-PNU-SW-Hackathon/PNUSW-2025-OnGi-10 that referenced this pull request Aug 25, 2025
* feat: 온도 상승 메서드 구현
feat: 통증 부위, 운동 시간 기록&조회 API에 온도 상승 메서드 적용

* feat: 보너스 온도 상승 메서드 스케줄러 처리
feat: 온도 하락 메서드 스케줄러로 구현

* feat: 온도 상승 수치 조정
feat: 통증, 운동 API 수정 및 테스트 완료
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant