Skip to content

Commit

Permalink
mod: 오름 반환값에 고유 id 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Song-EunJu committed Nov 17, 2022
1 parent d69ac35 commit 884660b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/example/goorm/oreum/OreumController.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class OreumController {
@PostMapping("/oreums")
public ResponseEntity<String> pushData(){
oreumService.readCsv();
return ResponseEntity.ok().body("완성");
return ResponseEntity.ok().body("DB 푸시 완료");
}

// 생일에 따른 오름 정보 보여주기 (입력하고 디비에 저장하는 거까지)
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/com/example/goorm/oreum/OreumService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ public class OreumService {
private final OreumRepository oreumRepository;
private final MyOreumRepository myOreumRepository;

public List<Oreum> getOreums(){
return oreumRepository.findAll();
}

public OreumResponse getOreum(BirthDayRequest request){
int month = request.getMonth();
int day = request.getDay();
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 884660b

Please sign in to comment.