package Ġcom . google . sh iny ay . controller Ċ Ċ import Ġcom . google . sh iny ay . entity . Book Ċ import Ġcom . google . sh iny ay . service . Book Service Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation .* Ċ Ċ @ RestController Ċ @ RequestMapping ("/ api / v 1 ") Ċ class ĠBook Controller ( val Ġservice : ĠBook Service ) Ġ{ ĊĊĠĠĠ Ġ@ GetMapping ("/ books ") ĊĠĠĠ Ġfun ĠfindAll Books (): ĠResponseEntity < Mutable List < Book >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . status ( HttpStatus . OK ). body ( service . findAll Books ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ books /{ isbn }") ĊĠĠĠ Ġfun Ġfind Book By Is bn (@ PathVariable Ġis bn : ĠString ): ĠResponseEntity < List < Book >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . status ( HttpStatus . OK ). body ( service . find Book By Is bn ( isbn )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ PostMapping ("/ books ") ĊĠĠĠ Ġfun Ġregister Book (@ RequestBody Ġbook : ĠBook ): ĠResponseEntity < Int > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . status ( HttpStatus . CREATED ). body ( service . repository . save Book ( book )) ĊĠĠĠ Ġ} Ċ }