package Ġbr . com . z up . controller Ċ Ċ import Ġbr . com . z up . controller . request . Autor Request Ċ import Ġbr . com . z up . controller . response . Det al he Autor Response Ċ import Ġbr . com . z up . repository . Autor Repository Ċ import Ġio . mic ronaut . http . HttpResponse Ċ import Ġio . mic ronaut . http . annotation . Body Ċ import Ġio . mic ronaut . http . annotation . Controller Ċ import Ġio . mic ronaut . http . annotation . PathVariable Ċ import Ġio . mic ronaut . http . annotation . Put Ċ import Ġio . mic ronaut . validation . Validated Ċ import Ġjavax . transaction . Transactional Ċ import Ġjavax . validation . Valid Ċ Ċ @ Validated Ċ @ Controller ("/ auto res ") Ċ class ĠA tual iza Autor Controller Ġ( val Ġautor Repository : ĠA utor Repository ){ ĊĊĠĠĠ Ġ@ Put ("/ { id }") ĊĠĠĠ Ġ@ Transactional ĊĠĠĠ Ġfun Ġatual iza (@ PathVariable Ġid : ĠLong , Ġ@ Body Ġ@ Valid Ġautor Request : ĠA utor Request ): ĠHttpResponse < Any >{ ĊĠĠĠĠĠĠĠ Ġval Ġexists Id Ġ= Ġautor Repository . findById ( id ) ĊĊĠĠĠĠĠĠĠ Ġif Ġ(! exists Id . isPresent ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠHttpResponse . not Found () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġautor Ġ= Ġexists Id . get () ĊĠĠĠĠĠĠĠ Ġautor . nome Ġ= Ġautor Request . nome ĊĠĠĠĠĠĠĠ Ġautor . email Ġ= Ġautor Request . email ĊĠĠĠĠĠĠĠ Ġautor . desc ricao Ġ= Ġautor Request . desc ricao ĊĊĠĠĠĠĠĠĠ Ġautor Repository . update ( autor ) ĊĊĠĠĠĠĠĠĠ Ġreturn ĠHttpResponse . ok ( Det al he Autor Response ( autor )) ĊĠĠĠ Ġ} Ċ }