package Ġk g . j edi . four angle . web . controller Ċ Ċ import Ġk g . j edi . four angle . bu is ness . service . Ad vert Crud Service Ċ import Ġk g . j edi . four angle . common . Endpoints Ċ import Ġk g . j edi . four angle . web . controller . dto . Ad vert Dto Ċ import Ġk g . j edi . four angle . web . controller . dto . Rest Response Ċ import Ġk g . j edi . four angle . web . controller . dto . to Ad vert Dto Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . PathVariable Ċ import Ġorg . springframework . web . bind . annotation . RequestMapping Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ Ċ @ RestController Ċ @ RequestMapping ( value Ġ= Ġ[ Endpoints . AD VERT _ V 1 ], Ġproduces Ġ= Ġ[ MediaType . APPLICATION _ JSON _ UTF 8 _ VALUE ]) Ċ class ĠAd vert Open Controller ( private Ġval Ġadvert Service : ĠAd vert Crud Service ) Ġ{ ĊĊĠĠĠ Ġ@ GetMapping ("/ { id :[ \\ d ]+ }") ĊĠĠĠ Ġfun Ġget (@ PathVariable Ġid : ĠLong ): ĠRest Response < Ad vert Dto > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmodel Ġ= Ġadvert Service . get ( id ) ĊĠĠĠĠĠĠĠ Ġval Ġadvert Dto Ġ= Ġmodel . to Ad vert Dto () ĊĠĠĠĠĠĠĠ Ġreturn ĠRest Response ( advert Dto ) ĊĠĠĠ Ġ} Ċ }