package Ġcom . br . z up . key manager . pix . register Ċ Ċ import Ġcom . br . z up . Proto Register Key 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 . Post Ċ import Ġio . mic ronaut . http . uri . Uri Builder Ċ import Ġio . mic ronaut . validation . Validated Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . validation . Valid Ċ Ċ @ Controller Ċ @ Validated Ċ class ĠRegister Key Controller (@ Inject Ġval Ġgrpc Client : ĠProto Register Key Service Grpc . Proto Register Key Service Blocking Stub ) Ġ{ ĊĊĠĠĠ Ġ@ Post ("/ api / key ") ĊĠĠĠ Ġfun Ġregister Key (@ Valid Ġ@ Body Ġrequest : ĠRegister Key Request ): ĠHttpResponse < Any > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġgrpc Client . register Key ( request . to Proto Register Key Request ()) ĊĠĠĠĠĠĠĠ Ġval Ġuri Ġ= ĠUri Builder . of ("/ api / key ? pix id ={ pix Id }& client id ={ clientId }") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. expand ( mutable Map Of (" pix Id " Ġto Ġresponse . pix Id , Ġ" clientId " Ġto Ġrequest . clientId )) ĊĠĠĠĠĠĠĠ Ġreturn ĠHttpResponse . created ( Register Key Response ( response . pix Id ), Ġuri ) ĊĠĠĠ Ġ} Ċ }