From f9be9515fa66ceca93b8ccfde0b4e77a3e60ebdf Mon Sep 17 00:00:00 2001 From: YuJungHyun <0703olivia@naver.com> Date: Tue, 22 Nov 2022 01:26:13 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20#40=20=EB=82=B4=20=EC=8B=9D=EB=AC=BC=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plantity/server/controller/MyPlantApiController.java | 3 +-- .../java/com/plantity/server/domain/myPlant/MyPlant.java | 6 ++---- .../server/domain/myPlant/MyPlantSaveRequestDto.java | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/server/src/main/java/com/plantity/server/controller/MyPlantApiController.java b/server/src/main/java/com/plantity/server/controller/MyPlantApiController.java index d634a6e..e827e75 100644 --- a/server/src/main/java/com/plantity/server/controller/MyPlantApiController.java +++ b/server/src/main/java/com/plantity/server/controller/MyPlantApiController.java @@ -65,7 +65,6 @@ public ResponseEntity save( @RequestPart(value = "plantName") String plantName, @RequestPart(value = "plantNickName") String plantNickName, @RequestPart(value = "plantAdaptTime") String plantAdaptTime, - @RequestPart(value = "plantType") String plantType, @PathVariable Long userId) throws IOException { try{ // cntntsNo로 해당 식물의 관수 설명도 함께 myPlant에 저장 @@ -87,7 +86,7 @@ public ResponseEntity save( Users users1 = new Users(usersRepository.findByUserId(userId)); - MyPlant myPlant = new MyPlant(plantName,plantNickName, plantAdaptTime,plantType, amazonS3.getUrl(bucket, filePath).toString(), watercycleSprngCodeNm, users1); + MyPlant myPlant = new MyPlant(plantName,plantNickName, plantAdaptTime,amazonS3.getUrl(bucket, filePath).toString(), watercycleSprngCodeNm, users1); //myPlantService.save(myPlantSaveRequestDto); myPlantRepository.save(myPlant); diff --git a/server/src/main/java/com/plantity/server/domain/myPlant/MyPlant.java b/server/src/main/java/com/plantity/server/domain/myPlant/MyPlant.java index 9701409..a6c6a17 100644 --- a/server/src/main/java/com/plantity/server/domain/myPlant/MyPlant.java +++ b/server/src/main/java/com/plantity/server/domain/myPlant/MyPlant.java @@ -35,8 +35,7 @@ public class MyPlant extends BaseTimeEntity { @OneToMany(mappedBy = "myPlant") private List plantLog = new ArrayList(); - private String plantName; //식물이름 - private String plantType; //식물타입 + private String plantName; //식물 타입 private String filePath; private String plantNickName; // 식물 별명 private String watercycleSprngCodeNm; // 관수코드 @@ -46,9 +45,8 @@ public class MyPlant extends BaseTimeEntity { private String plantAdaptTime; //식물입양날짜 @Builder - public MyPlant(String plantName, String plantNickName, String plantAdaptTime, String plantType, String filePath, String watercycleSprngCodeNm, Users users) { + public MyPlant(String plantName, String plantNickName, String plantAdaptTime, String filePath, String watercycleSprngCodeNm, Users users) { this.plantName = plantName; - this.plantType = plantType; this.filePath = filePath; this.plantAdaptTime = plantAdaptTime; this.plantNickName = plantNickName; diff --git a/server/src/main/java/com/plantity/server/domain/myPlant/MyPlantSaveRequestDto.java b/server/src/main/java/com/plantity/server/domain/myPlant/MyPlantSaveRequestDto.java index a453a18..30c1102 100644 --- a/server/src/main/java/com/plantity/server/domain/myPlant/MyPlantSaveRequestDto.java +++ b/server/src/main/java/com/plantity/server/domain/myPlant/MyPlantSaveRequestDto.java @@ -13,17 +13,17 @@ public class MyPlantSaveRequestDto { private String plantName; //식물이름 - private String plantType; //타입 + private String plantNickName; //식물 별명 private String filePath; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") private String plantAdaptTime; //입양날짜 @Builder - public MyPlantSaveRequestDto(String plantName, String plantType, String filePath, String plantAdaptTime) { + public MyPlantSaveRequestDto(String plantName, String plantNickName, String filePath, String plantAdaptTime) { //식물이름, 타입, 이미지, 입양날짜 this.plantName = plantName; //식물이름 - this.plantType = plantType; //타입 + this.plantNickName = plantNickName; //타입 this.filePath = filePath; //이미지 this.plantAdaptTime = plantAdaptTime; //입양날짜 } @@ -31,7 +31,7 @@ public MyPlantSaveRequestDto(String plantName, String plantType, String filePath public MyPlant toEntity() { return MyPlant.builder() .plantName(plantName) - .plantType(plantType) + .plantNickName(plantNickName) .filePath(filePath) .plantAdaptTime(plantAdaptTime) .build();