package Ġcom . github . al berto sd lf . k mic ronaut . controller Ċ Ċ import Ġcom . github . al berto sd lf . k mic ronaut . controller . model . Error Dto Ċ import Ġcom . github . al berto sd lf . k mic ronaut . controller . model . ResponseBody Dto Ċ import Ġcom . github . al berto sd lf . k mic ronaut . service . Person Service Ċ import Ġcom . github . al berto sd lf . k mic ronaut . service . mapper . Person Mapper Ċ import Ġio . mic ronaut . http . MediaType Ċ import Ġio . mic ronaut . http . annotation . Controller Ċ import Ġio . mic ronaut . http . annotation . Get Ċ import Ġio . mic ronaut . http . annotation . Produces Ċ import Ġio . reactivex . Maybe Ċ import Ġorg . map struct . factory . Map pers Ċ import Ġjavax . inject . Inject Ċ Ċ @ Controller ("/ api / person ") Ċ @ Produces ( MediaType . APPLICATION _ JSON ) Ċ class ĠPerson Controller Ġ{ ĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġperson Service : ĠPerson Service ĊĊĠĠĠ Ġprivate Ġvar Ġperson Mapper : ĠPerson Mapper Ġ= ĠMap pers . get Mapper ( Person Mapper :: class . java ) ĊĊĠĠĠ Ġ@ Get ("/ { id }") ĊĠĠĠ Ġfun Ġget Person ( id : ĠString ): ĠMaybe < ResponseBody Dto > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis . person Service . get Person ( id ). map Ġ{ Ġperson Ġ-> Ġthis . person Mapper . convertTo Dto ( person ) Ġ} ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠThrowable ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMaybe . just ( Error Dto (" TEST ")) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }