From 884660b0c2d0f1ceba0b5bf510a145d6f9078f7a Mon Sep 17 00:00:00 2001 From: Song-EunJu Date: Thu, 17 Nov 2022 17:06:40 +0900 Subject: [PATCH] =?UTF-8?q?mod:=20=EC=98=A4=EB=A6=84=20=EB=B0=98=ED=99=98?= =?UTF-8?q?=EA=B0=92=EC=97=90=20=EA=B3=A0=EC=9C=A0=20id=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/goorm/oreum/OreumController.java | 2 +- src/main/java/com/example/goorm/oreum/OreumService.java | 5 +---- src/main/java/com/example/goorm/oreum/dto/OreumResponse.java | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/example/goorm/oreum/OreumController.java b/src/main/java/com/example/goorm/oreum/OreumController.java index 9d278df..8b05f6d 100644 --- a/src/main/java/com/example/goorm/oreum/OreumController.java +++ b/src/main/java/com/example/goorm/oreum/OreumController.java @@ -22,7 +22,7 @@ public class OreumController { @PostMapping("/oreums") public ResponseEntity pushData(){ oreumService.readCsv(); - return ResponseEntity.ok().body("완성"); + return ResponseEntity.ok().body("DB 푸시 완료"); } // 생일에 따른 오름 정보 보여주기 (입력하고 디비에 저장하는 거까지) diff --git a/src/main/java/com/example/goorm/oreum/OreumService.java b/src/main/java/com/example/goorm/oreum/OreumService.java index a442bfe..c099fe6 100644 --- a/src/main/java/com/example/goorm/oreum/OreumService.java +++ b/src/main/java/com/example/goorm/oreum/OreumService.java @@ -19,10 +19,6 @@ public class OreumService { private final OreumRepository oreumRepository; private final MyOreumRepository myOreumRepository; - public List getOreums(){ - return oreumRepository.findAll(); - } - public OreumResponse getOreum(BirthDayRequest request){ int month = request.getMonth(); int day = request.getDay(); @@ -75,6 +71,7 @@ public void readCsv(){ .month(monthCheck) .day(dayCheck) .build(); + oreum.toTypeEnum(type); oreumRepository.save(oreum); if((monthCheck == 1 || monthCheck == 3 || monthCheck == 5 || monthCheck == 7 diff --git a/src/main/java/com/example/goorm/oreum/dto/OreumResponse.java b/src/main/java/com/example/goorm/oreum/dto/OreumResponse.java index caa4d52..2a1da70 100644 --- a/src/main/java/com/example/goorm/oreum/dto/OreumResponse.java +++ b/src/main/java/com/example/goorm/oreum/dto/OreumResponse.java @@ -39,6 +39,7 @@ public static OreumResponse ofOthers(Oreum oreum, MyOreum myOreum){ .xPos(oreum.getXPos()) .yPos(oreum.getYPos()) .zPos(oreum.getZPos()) + .myOreumId(myOreum.getId()) .build(); } } \ No newline at end of file