package Ġio . piv otal . sh iny ay . controller Ċ Ċ import Ġio . piv otal . sh iny ay . entity . Person Ċ import Ġio . piv otal . sh iny ay . repository . Person Repository Ċ import Ġorg . springframework . web . bind . annotation .* Ċ Ċ @ RestController Ċ @ RequestMapping ("/ persons ") Ċ class ĠPerson Controller ( val Ġrepository : ĠPerson Repository ) Ġ{ ĊĊĠĠĠ Ġ@ GetMapping ĊĠĠĠ Ġfun ĠfindAll () Ġ= Ġrepository . findAll () ĊĊĠĠĠ Ġ@ GetMapping ("/ { id }") ĊĠĠĠ Ġfun Ġfind ById (@ PathVariable Ġid : ĠInt ) Ġ= Ġrepository . findById ( id ) ĊĊĠĠĠ Ġ@ PostMapping ĊĠĠĠ Ġfun Ġadd (@ RequestBody Ġperson : ĠPerson ) Ġ= Ġrepository . save ( person ) ĊĊĠĠĠ Ġ@ Put Mapping ĊĠĠĠ Ġfun Ġupdate (@ RequestBody Ġperson : ĠPerson ) Ġ= Ġrepository . update ( person ) ĊĊĠĠĠ Ġ@ Delete Mapping ("/ { id }") ĊĠĠĠ Ġfun Ġremove (@ PathVariable Ġid : ĠInt ) Ġ= Ġrepository . remove ById ( id ) Ċ }