From a6cc9d39fbdccb476727d652431f9df387eb259d Mon Sep 17 00:00:00 2001 From: tlarbals824 Date: Thu, 25 May 2023 18:03:12 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20mypet=20petAge=20=EA=B0=92=EC=97=90=200?= =?UTF-8?q?=EB=B3=B4=EB=8B=A4=20=ED=81=B0=20=EC=88=AB=EC=9E=90=20=EC=9D=B4?= =?UTF-8?q?=EC=99=B8=EC=9D=98=20=EA=B0=92=EC=9D=B4=20=EC=9E=85=EB=A0=A5?= =?UTF-8?q?=EB=90=98=EB=A9=B4=20=EB=B0=98=EC=98=81=20=EC=95=88=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/application/dto/request/MyPetUpdateRequest.java | 4 ++-- .../com/kusitms/samsion/domain/user/domain/entity/MyPet.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/kusitms/samsion/domain/user/application/dto/request/MyPetUpdateRequest.java b/src/main/java/com/kusitms/samsion/domain/user/application/dto/request/MyPetUpdateRequest.java index 2ad7905..0d4df7b 100644 --- a/src/main/java/com/kusitms/samsion/domain/user/application/dto/request/MyPetUpdateRequest.java +++ b/src/main/java/com/kusitms/samsion/domain/user/application/dto/request/MyPetUpdateRequest.java @@ -38,9 +38,9 @@ private int petAgeParse(String petAge) { try{ return Integer.parseInt(petAge); }catch (NumberFormatException e){ - return 0; + return -1; } } - return 0; + return -1; } } diff --git a/src/main/java/com/kusitms/samsion/domain/user/domain/entity/MyPet.java b/src/main/java/com/kusitms/samsion/domain/user/domain/entity/MyPet.java index fbbc727..0d5f1d3 100644 --- a/src/main/java/com/kusitms/samsion/domain/user/domain/entity/MyPet.java +++ b/src/main/java/com/kusitms/samsion/domain/user/domain/entity/MyPet.java @@ -64,7 +64,7 @@ private void updateDescription(String description) { } private void updatePetAge(int petAge) { - if (!Objects.equals(petAge, this.petAge)) + if (!Objects.equals(petAge, this.petAge)&&petAge>=0) this.petAge = petAge; }