package Ġcom . wo ow r ale . person as . api Ċ Ċ import Ġcom . wo ow r ale . person as . data . model . Person a Ċ import Ġcom . wo ow r ale . person as . data . model . Person as Ċ import Ġcom . wo ow r ale . person as . data . service . Person a Service Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . cloud . context . config . annotation . Refresh Scope Ċ import Ġorg . springframework . web . bind . annotation . PathVariable Ċ import Ġorg . springframework . web . bind . annotation . RequestBody Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ Ċ @ Refresh Scope Ċ @ RestController Ċ class ĠPerson a Api Controller Ġ: ĠPerson a Api Ġ{ ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġservice : ĠPerson a Service ĊĊĠĠĠ Ġoverride Ġfun Ġinsert (@ RequestBody Ġperson a : ĠPerson a ) Ġ{ ĊĠĠĠĠĠĠĠ Ġservice . insert Person a ( persona ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdelete (@ PathVariable ( value Ġ= Ġ" id ") Ġid : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġservice . delete Person a ( id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsearch All (): ĠPerson as Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġservice . search All () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsearch ById (@ PathVariable ( value Ġ= Ġ" id ") Ġid : ĠString ): ĠPerson as Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġservice . search ById ( id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġread (@ PathVariable ( value Ġ= Ġ" id ") Ġid : ĠString , Ġ@ RequestBody Ġperson a : ĠPerson a ) Ġ{ ĊĠĠĠĠĠĠĠ Ġservice . update ( id , Ġperson a ) ĊĠĠĠ Ġ} Ċ }