From 186f5fcf8dfab93202684978e7325addb94c2b32 Mon Sep 17 00:00:00 2001 From: RyuKwanKon Date: Tue, 23 Jan 2024 11:22:30 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[fix]=20#59=20=EC=B2=B4=ED=81=AC=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../converter/SleepGridingTypeConverter.java | 12 ---------- .../converter/SleepGrindingTypeConverter.java | 12 ++++++++++ .../dto/request/CheckListRequestDto.java | 2 +- .../dto/response/CheckListResponseDto.java | 23 ++++++++++--------- .../domain/checkList/entity/CheckList.java | 8 +++---- .../checkList/entity/PostCheckList.java | 8 +++---- ...ridingType.java => SleepGrindingType.java} | 6 ++--- .../checkList/entity/SleepSnoreType.java | 2 +- .../checkList/utils/MatchRateCalculator.java | 2 +- 9 files changed, 38 insertions(+), 37 deletions(-) delete mode 100644 src/main/java/org/gachon/checkmate/domain/checkList/converter/SleepGridingTypeConverter.java create mode 100644 src/main/java/org/gachon/checkmate/domain/checkList/converter/SleepGrindingTypeConverter.java rename src/main/java/org/gachon/checkmate/domain/checkList/entity/{SleepGridingType.java => SleepGrindingType.java} (74%) diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/converter/SleepGridingTypeConverter.java b/src/main/java/org/gachon/checkmate/domain/checkList/converter/SleepGridingTypeConverter.java deleted file mode 100644 index 3df6847..0000000 --- a/src/main/java/org/gachon/checkmate/domain/checkList/converter/SleepGridingTypeConverter.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.gachon.checkmate.domain.checkList.converter; - -import jakarta.persistence.Converter; -import org.gachon.checkmate.domain.checkList.entity.SleepGridingType; -import org.gachon.checkmate.global.utils.AbstractEnumCodeAttributeConverter; - -@Converter -public class SleepGridingTypeConverter extends AbstractEnumCodeAttributeConverter { - public SleepGridingTypeConverter() { - super(SleepGridingType.class); - } -} diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/converter/SleepGrindingTypeConverter.java b/src/main/java/org/gachon/checkmate/domain/checkList/converter/SleepGrindingTypeConverter.java new file mode 100644 index 0000000..a747d36 --- /dev/null +++ b/src/main/java/org/gachon/checkmate/domain/checkList/converter/SleepGrindingTypeConverter.java @@ -0,0 +1,12 @@ +package org.gachon.checkmate.domain.checkList.converter; + +import jakarta.persistence.Converter; +import org.gachon.checkmate.domain.checkList.entity.SleepGrindingType; +import org.gachon.checkmate.global.utils.AbstractEnumCodeAttributeConverter; + +@Converter +public class SleepGrindingTypeConverter extends AbstractEnumCodeAttributeConverter { + public SleepGrindingTypeConverter() { + super(SleepGrindingType.class); + } +} diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/dto/request/CheckListRequestDto.java b/src/main/java/org/gachon/checkmate/domain/checkList/dto/request/CheckListRequestDto.java index 79f1221..8b25d77 100644 --- a/src/main/java/org/gachon/checkmate/domain/checkList/dto/request/CheckListRequestDto.java +++ b/src/main/java/org/gachon/checkmate/domain/checkList/dto/request/CheckListRequestDto.java @@ -9,7 +9,7 @@ public record CheckListRequestDto( LifePatternType lifePatternType, CallType callType, EarPhoneType earPhoneType, - SleepGridingType sleepGridingType, + SleepGrindingType sleepGrindingType, SleepSnoreType sleepSnoreType, SleepTalkingType sleepTalkingType, SleepTurningType sleepTurningType, diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/dto/response/CheckListResponseDto.java b/src/main/java/org/gachon/checkmate/domain/checkList/dto/response/CheckListResponseDto.java index 2966e82..c07d39f 100644 --- a/src/main/java/org/gachon/checkmate/domain/checkList/dto/response/CheckListResponseDto.java +++ b/src/main/java/org/gachon/checkmate/domain/checkList/dto/response/CheckListResponseDto.java @@ -1,17 +1,18 @@ package org.gachon.checkmate.domain.checkList.dto.response; import lombok.Builder; -import org.gachon.checkmate.domain.checkList.entity.*; +import org.gachon.checkmate.domain.checkList.entity.CheckList; +import org.gachon.checkmate.domain.checkList.entity.PostCheckList; @Builder public record CheckListResponseDto( String cleanType, String drinkType, String homeType, - String lifePatterType, + String lifePatternType, String callType, String earPhoneType, - String sleepGridingType, + String sleepGrindingType, String sleepSnoreType, String sleepTalkingType, String sleepTurningType, @@ -22,10 +23,10 @@ public static CheckListResponseDto of(CheckList checkList) { .cleanType(checkList.getCleanType().getDesc()) .drinkType(checkList.getDrinkType().getDesc()) .homeType(checkList.getHomeType().getDesc()) - .lifePatterType(checkList.getLifePatternType().getDesc()) - .callType(checkList.getCallType().getCode()) - .earPhoneType(checkList.getEarPhoneType().getCode()) - .sleepGridingType(checkList.getSleepGridingType().getDesc()) + .lifePatternType(checkList.getLifePatternType().getDesc()) + .callType(checkList.getCallType().getDesc()) + .earPhoneType(checkList.getEarPhoneType().getDesc()) + .sleepGrindingType(checkList.getSleepGrindingType().getDesc()) .sleepSnoreType(checkList.getSleepSnoreType().getDesc()) .sleepTalkingType(checkList.getSleepTalkingType().getDesc()) .sleepTurningType(checkList.getSleepTurningType().getDesc()) @@ -38,10 +39,10 @@ public static CheckListResponseDto ofPostCheckList(PostCheckList checkList) { .cleanType(checkList.getCleanType().getDesc()) .drinkType(checkList.getDrinkType().getDesc()) .homeType(checkList.getHomeType().getDesc()) - .lifePatterType(checkList.getLifePatternType().getDesc()) - .callType(checkList.getCallType().getCode()) - .earPhoneType(checkList.getEarPhoneType().getCode()) - .sleepGridingType(checkList.getSleepGridingType().getDesc()) + .lifePatternType(checkList.getLifePatternType().getDesc()) + .callType(checkList.getCallType().getDesc()) + .earPhoneType(checkList.getEarPhoneType().getDesc()) + .sleepGrindingType(checkList.getSleepGrindingType().getDesc()) .sleepSnoreType(checkList.getSleepSnoreType().getDesc()) .sleepTalkingType(checkList.getSleepTalkingType().getDesc()) .sleepTurningType(checkList.getSleepTurningType().getDesc()) diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/entity/CheckList.java b/src/main/java/org/gachon/checkmate/domain/checkList/entity/CheckList.java index d1f62a4..1086876 100644 --- a/src/main/java/org/gachon/checkmate/domain/checkList/entity/CheckList.java +++ b/src/main/java/org/gachon/checkmate/domain/checkList/entity/CheckList.java @@ -29,8 +29,8 @@ public class CheckList extends BaseTimeEntity { private CallType callType; @Convert(converter = EarPhoneTypeConverter.class) private EarPhoneType earPhoneType; - @Convert(converter = SleepGridingTypeConverter.class) - private SleepGridingType sleepGridingType; + @Convert(converter = SleepGrindingTypeConverter.class) + private SleepGrindingType sleepGrindingType; @Convert(converter = SleepSnoreTypeConverter.class) private SleepSnoreType sleepSnoreType; @Convert(converter = SleepTalkingTypeConverter.class) @@ -51,7 +51,7 @@ public static CheckList createCheckList(User user, CheckListRequestDto checkList .lifePatternType(checkListRequestDto.lifePatternType()) .callType(checkListRequestDto.callType()) .earPhoneType(checkListRequestDto.earPhoneType()) - .sleepGridingType(checkListRequestDto.sleepGridingType()) + .sleepGrindingType(checkListRequestDto.sleepGrindingType()) .sleepSnoreType(checkListRequestDto.sleepSnoreType()) .sleepTalkingType(checkListRequestDto.sleepTalkingType()) .sleepTurningType(checkListRequestDto.sleepTurningType()) @@ -69,7 +69,7 @@ public void updateCheckList(CheckListRequestDto checkListRequestDto) { this.lifePatternType = checkListRequestDto.lifePatternType(); this.callType = checkListRequestDto.callType(); this.earPhoneType = checkListRequestDto.earPhoneType(); - this.sleepGridingType = checkListRequestDto.sleepGridingType(); + this.sleepGrindingType = checkListRequestDto.sleepGrindingType(); this.sleepSnoreType = checkListRequestDto.sleepSnoreType(); this.sleepTalkingType = checkListRequestDto.sleepTalkingType(); this.sleepTurningType = checkListRequestDto.sleepTurningType(); diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/entity/PostCheckList.java b/src/main/java/org/gachon/checkmate/domain/checkList/entity/PostCheckList.java index 71225eb..add3608 100644 --- a/src/main/java/org/gachon/checkmate/domain/checkList/entity/PostCheckList.java +++ b/src/main/java/org/gachon/checkmate/domain/checkList/entity/PostCheckList.java @@ -29,8 +29,8 @@ public class PostCheckList extends BaseTimeEntity { private CallType callType; @Convert(converter = EarPhoneTypeConverter.class) private EarPhoneType earPhoneType; - @Convert(converter = SleepGridingTypeConverter.class) - private SleepGridingType sleepGridingType; + @Convert(converter = SleepGrindingTypeConverter.class) + private SleepGrindingType sleepGrindingType; @Convert(converter = SleepSnoreTypeConverter.class) private SleepSnoreType sleepSnoreType; @Convert(converter = SleepTalkingTypeConverter.class) @@ -51,7 +51,7 @@ public static PostCheckList createPostCheckList(CheckListRequestDto checkListReq .lifePatternType(checkListRequestDto.lifePatternType()) .callType(checkListRequestDto.callType()) .earPhoneType(checkListRequestDto.earPhoneType()) - .sleepGridingType(checkListRequestDto.sleepGridingType()) + .sleepGrindingType(checkListRequestDto.sleepGrindingType()) .sleepSnoreType(checkListRequestDto.sleepSnoreType()) .sleepTalkingType(checkListRequestDto.sleepTalkingType()) .sleepTurningType(checkListRequestDto.sleepTurningType()) @@ -69,7 +69,7 @@ public void updatePostCheckList(CheckListRequestDto checkListRequestDto) { this.lifePatternType = checkListRequestDto.lifePatternType(); this.callType = checkListRequestDto.callType(); this.earPhoneType = checkListRequestDto.earPhoneType(); - this.sleepGridingType = checkListRequestDto.sleepGridingType(); + this.sleepGrindingType = checkListRequestDto.sleepGrindingType(); this.sleepSnoreType = checkListRequestDto.sleepSnoreType(); this.sleepTalkingType = checkListRequestDto.sleepTalkingType(); this.sleepTurningType = checkListRequestDto.sleepTurningType(); diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepGridingType.java b/src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepGrindingType.java similarity index 74% rename from src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepGridingType.java rename to src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepGrindingType.java index 0635621..3eae0b4 100644 --- a/src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepGridingType.java +++ b/src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepGrindingType.java @@ -7,14 +7,14 @@ @AllArgsConstructor(access = AccessLevel.PRIVATE) @Getter -public enum SleepGridingType implements EnumField { - TRUE("1", "코골이"), +public enum SleepGrindingType implements EnumField { + TRUE("1", "이갈이"), FALSE("2", "false"); private final String code; private final String desc; - public int compareRateTo(SleepGridingType e) { + public int compareRateTo(SleepGrindingType e) { return this.equals(e) ? 1 : 0; } } diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepSnoreType.java b/src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepSnoreType.java index f88638a..95866fe 100644 --- a/src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepSnoreType.java +++ b/src/main/java/org/gachon/checkmate/domain/checkList/entity/SleepSnoreType.java @@ -8,7 +8,7 @@ @AllArgsConstructor(access = AccessLevel.PRIVATE) @Getter public enum SleepSnoreType implements EnumField { - TRUE("1", "이갈이"), + TRUE("1", "코골이"), FALSE("2", "false"); private final String code; diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/utils/MatchRateCalculator.java b/src/main/java/org/gachon/checkmate/domain/checkList/utils/MatchRateCalculator.java index 2982197..e99c627 100644 --- a/src/main/java/org/gachon/checkmate/domain/checkList/utils/MatchRateCalculator.java +++ b/src/main/java/org/gachon/checkmate/domain/checkList/utils/MatchRateCalculator.java @@ -12,7 +12,7 @@ public static int getAccuracy(PostCheckList postCheckList, CheckList checkList) count += postCheckList.getLifePatternType().compareRateTo(checkList.getLifePatternType()); count += postCheckList.getCallType().compareRateTo(checkList.getCallType()); count += postCheckList.getEarPhoneType().compareRateTo(checkList.getEarPhoneType()); - count += postCheckList.getSleepGridingType().compareRateTo(checkList.getSleepGridingType()); + count += postCheckList.getSleepGrindingType().compareRateTo(checkList.getSleepGrindingType()); count += postCheckList.getSleepSnoreType().compareRateTo(checkList.getSleepSnoreType()); count += postCheckList.getSleepTalkingType().compareRateTo(checkList.getSleepTalkingType()); count += postCheckList.getSleepTurningType().compareRateTo(checkList.getSleepTurningType()); From ef9add16136b01d0279cfbb20783cace570b2538 Mon Sep 17 00:00:00 2001 From: RyuKwanKon Date: Tue, 23 Jan 2024 20:08:25 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[fix]=20#59=20=EC=B2=B4=ED=81=AC=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=88=98=EC=A0=95=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/checkList/controller/CheckListController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/gachon/checkmate/domain/checkList/controller/CheckListController.java b/src/main/java/org/gachon/checkmate/domain/checkList/controller/CheckListController.java index 144ea58..3e12f60 100644 --- a/src/main/java/org/gachon/checkmate/domain/checkList/controller/CheckListController.java +++ b/src/main/java/org/gachon/checkmate/domain/checkList/controller/CheckListController.java @@ -25,6 +25,7 @@ public ResponseEntity> createCheckList(@UserId final Long use @PatchMapping("/my") public ResponseEntity> updateCheckList(@UserId final Long userId, @RequestBody final CheckListRequestDto checkListRequestDto) { + System.out.println("my logs " + checkListRequestDto.cleanType()); checkListService.updateCheckList(userId, checkListRequestDto); return SuccessResponse.ok(null); }