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

dto changes

parent 4d8d4bc8
......@@ -26,9 +26,9 @@ public class BabyDto {
@NotEmpty(message = "Baby's gender is required")
private String sex;
private String status = STATUS_NEW;
private boolean isActive;
private float weight;
private float height;
private Boolean isActive;
private Float weight;
private Float height;
private String bloodType;
private String eyeColor;
private String hairColor;
......
......@@ -23,9 +23,9 @@ public class Baby {
private LocalDate dob;
private String sex;
private String status;
private boolean isActive;
private float weight;
private float height;
private Boolean isActive;
private Float weight;
private Float height;
private String bloodType;
private String eyeColor;
private String hairColor;
......
......@@ -33,19 +33,19 @@ public class BabyController {
return ResponseEntity.ok(babyService.getAllBabies());
}
@GetMapping("/{id}")
@GetMapping("/{babyId}")
public ResponseEntity<BabyDto> getBabyById(@PathVariable Long babyId) {
log.info("Inside baby controller getBabyById method");
return ResponseEntity.ok(babyService.getBabyById(babyId));
}
@PutMapping("/{id}")
@PutMapping("/{babyId}")
public ResponseEntity<BabyDto> updateBaby(@PathVariable Long babyId, @RequestBody BabyDto babyDto) {
log.info("Inside baby controller updateBaby method");
return ResponseEntity.ok(babyService.updateBaby(babyId, babyDto));
}
@DeleteMapping("/{id}")
@DeleteMapping("/{babyId}")
public ResponseEntity<ResponseDto> deleteBaby(@PathVariable Long babyId) {
log.info("Inside baby controller deleteBaby method");
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