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