From ebbc8814ffbe64faa09b58c4ebd82cb248293c3f Mon Sep 17 00:00:00 2001 From: wschoe Date: Sun, 3 Sep 2023 17:04:30 +0900 Subject: [PATCH] refactor: add neck Angle to healthInfo --- .../backend/domain/health/domain/HealthInfo.java | 5 ++++- .../domain/health/dto/request/RecordInfo.java | 1 + .../domain/health/dto/request/RecordRequest.java | 12 ------------ .../backend/domain/health/service/HealthService.java | 1 + 4 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 src/main/java/com/tukorea/turtleneck/backend/domain/health/dto/request/RecordRequest.java diff --git a/src/main/java/com/tukorea/turtleneck/backend/domain/health/domain/HealthInfo.java b/src/main/java/com/tukorea/turtleneck/backend/domain/health/domain/HealthInfo.java index bb3c24d..8b4fd52 100644 --- a/src/main/java/com/tukorea/turtleneck/backend/domain/health/domain/HealthInfo.java +++ b/src/main/java/com/tukorea/turtleneck/backend/domain/health/domain/HealthInfo.java @@ -30,10 +30,12 @@ public class HealthInfo extends BaseEntity { private Long headAngle; + private Long neckAngle; + private Long distanceMonitor; @Builder - public HealthInfo(MemberEntity memberEntity, Integer redCnt, Integer yellowCnt, Integer greenCnt, Long shoulderAngle, Long headAngle, Long distanceMonitor){ + public HealthInfo(MemberEntity memberEntity, Integer redCnt, Integer yellowCnt, Integer greenCnt, Long shoulderAngle, Long headAngle, Long neckAngle, Long distanceMonitor){ this.memberEntity = memberEntity; this.redCnt = redCnt; this.yellowCnt = yellowCnt; @@ -41,6 +43,7 @@ public HealthInfo(MemberEntity memberEntity, Integer redCnt, Integer yellowCnt, this.isActive = true; this.shoulderAngle = shoulderAngle; this.headAngle = headAngle; + this.neckAngle = neckAngle; this.distanceMonitor = distanceMonitor; } } diff --git a/src/main/java/com/tukorea/turtleneck/backend/domain/health/dto/request/RecordInfo.java b/src/main/java/com/tukorea/turtleneck/backend/domain/health/dto/request/RecordInfo.java index fc10aca..31ee4ea 100644 --- a/src/main/java/com/tukorea/turtleneck/backend/domain/health/dto/request/RecordInfo.java +++ b/src/main/java/com/tukorea/turtleneck/backend/domain/health/dto/request/RecordInfo.java @@ -13,5 +13,6 @@ public class RecordInfo { private Integer greenCnt; private Long shoulderAngle; private Long headAngle; + private Long neckAngle; private Long distanceMonitor; } diff --git a/src/main/java/com/tukorea/turtleneck/backend/domain/health/dto/request/RecordRequest.java b/src/main/java/com/tukorea/turtleneck/backend/domain/health/dto/request/RecordRequest.java deleted file mode 100644 index 92a7dee..0000000 --- a/src/main/java/com/tukorea/turtleneck/backend/domain/health/dto/request/RecordRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.tukorea.turtleneck.backend.domain.health.dto.request; - -import lombok.*; - -import java.util.List; - -@Getter -@AllArgsConstructor -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public class RecordRequest { - private List infos; -} diff --git a/src/main/java/com/tukorea/turtleneck/backend/domain/health/service/HealthService.java b/src/main/java/com/tukorea/turtleneck/backend/domain/health/service/HealthService.java index 61b2a98..4712847 100644 --- a/src/main/java/com/tukorea/turtleneck/backend/domain/health/service/HealthService.java +++ b/src/main/java/com/tukorea/turtleneck/backend/domain/health/service/HealthService.java @@ -27,6 +27,7 @@ private HealthInfo recordSingleInfo(RecordInfo info){ .greenCnt(info.getGreenCnt()) .shoulderAngle(info.getShoulderAngle()) .headAngle(info.getHeadAngle()) + .neckAngle(info.getNeckAngle()) .distanceMonitor(info.getDistanceMonitor()) .build(); return healthRepository.save(singleInfo);