Commit 20e860a0 authored by Chamod Ishankha's avatar Chamod Ishankha

dto changes

parent 4d8d4bc8
...@@ -26,9 +26,9 @@ public class BabyDto { ...@@ -26,9 +26,9 @@ public class BabyDto {
@NotEmpty(message = "Baby's gender is required") @NotEmpty(message = "Baby's gender is required")
private String sex; private String sex;
private String status = STATUS_NEW; private String status = STATUS_NEW;
private boolean isActive; private Boolean isActive;
private float weight; private Float weight;
private float height; private Float height;
private String bloodType; private String bloodType;
private String eyeColor; private String eyeColor;
private String hairColor; private String hairColor;
......
...@@ -23,9 +23,9 @@ public class Baby { ...@@ -23,9 +23,9 @@ public class Baby {
private LocalDate dob; private LocalDate dob;
private String sex; private String sex;
private String status; private String status;
private boolean isActive; private Boolean isActive;
private float weight; private Float weight;
private float height; private Float height;
private String bloodType; private String bloodType;
private String eyeColor; private String eyeColor;
private String hairColor; private String hairColor;
......
...@@ -33,19 +33,19 @@ public class BabyController { ...@@ -33,19 +33,19 @@ public class BabyController {
return ResponseEntity.ok(babyService.getAllBabies()); return ResponseEntity.ok(babyService.getAllBabies());
} }
@GetMapping("/{id}") @GetMapping("/{babyId}")
public ResponseEntity<BabyDto> getBabyById(@PathVariable Long babyId) { public ResponseEntity<BabyDto> getBabyById(@PathVariable Long babyId) {
log.info("Inside baby controller getBabyById method"); log.info("Inside baby controller getBabyById method");
return ResponseEntity.ok(babyService.getBabyById(babyId)); return ResponseEntity.ok(babyService.getBabyById(babyId));
} }
@PutMapping("/{id}") @PutMapping("/{babyId}")
public ResponseEntity<BabyDto> updateBaby(@PathVariable Long babyId, @RequestBody BabyDto babyDto) { public ResponseEntity<BabyDto> updateBaby(@PathVariable Long babyId, @RequestBody BabyDto babyDto) {
log.info("Inside baby controller updateBaby method"); log.info("Inside baby controller updateBaby method");
return ResponseEntity.ok(babyService.updateBaby(babyId, babyDto)); return ResponseEntity.ok(babyService.updateBaby(babyId, babyDto));
} }
@DeleteMapping("/{id}") @DeleteMapping("/{babyId}")
public ResponseEntity<ResponseDto> deleteBaby(@PathVariable Long babyId) { public ResponseEntity<ResponseDto> deleteBaby(@PathVariable Long babyId) {
log.info("Inside baby controller deleteBaby method"); log.info("Inside baby controller deleteBaby method");
return ResponseEntity.ok(babyService.deleteBaby(babyId)); return ResponseEntity.ok(babyService.deleteBaby(babyId));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment