package Ġbr . com . z up . edu . register new pix Ċ Ċ import Ġbr . com . z up . edu . Key Manager Register Service Grpc Ċ 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 . Post Ċ import Ġio . mic ronaut . http . uri . Uri Builder Ċ import Ġio . mic ronaut . validation . Validated Ċ import Ġjak arta . inject . Inject Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġjava . util .* Ċ import Ġjavax . validation . Valid Ċ Ċ @ Validated Ċ @ Controller ( value Ġ= Ġ"/ api / v 1 / client es /{ cliente Id }/ pix ") Ċ class ĠNew Pix Controller ( ĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġval Ġregistry Pix Client : ĠKey Manager Register Service Grpc . Key Manager Register Service Blocking Stub , ĊĊĠĠĠ Ġ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠLoggerFactory . getLogger ( this :: class . java ) ĊĊĠĠĠ Ġ@ Post ĊĠĠĠ Ġfun Ġregister ( ĊĠĠĠĠĠĠĠ Ġ@ PathVariable (" cliente Id ") Ġcliente Id : ĠUUID , ĊĠĠĠĠĠĠĠ Ġ@ Valid Ġ@ Body Ġrequest : ĠNew Pix Request , ĊĠĠĠ Ġ): ĠHttpResponse < New Pix Response > Ġ{ ĊĠĠĠĠĠĠĠ Ġlogger . info (" method = register , Ġmsg = register ing Ġnew Ġpix Ġkey : Ġ{}, Ġfor Ġuser : Ġ{}", Ġrequest . pix Value , Ġcliente Id ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġregistry Pix Client . register Key ( request . to Grpc Model ( cliente Id )) ĊĊĠĠĠĠĠĠĠ Ġval Ġuri Ġ= ĠUri Builder ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. of ("/ api / v 1 / pix /{ pix Id }") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. expand ( mutable Map Of ( Pair (" pix Id ", Ġresponse . pix Id ))) ĊĠĠĠĠĠĠĠ Ġreturn ĠHttpResponse . created ( uri ) ĊĊĠĠĠ Ġ} Ċ }