package Ġ{{ PACKAGE _ NAME }}. post Ċ Ċ import Ġ{{ PACKAGE _ NAME }}. post . model . Post Ċ 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 ("/ posts ") Ċ internal Ġclass ĠPost Controller ( ĊĠ Ġprivate Ġval Ġpost Service : ĠPost Service Ċ ) Ġ{ ĊĊĠ Ġ@ GetMapping ĊĠ Ġfun ĠfindAll Post (): ĠList < Post > Ġ= ĊĠĠĠ Ġthis . post Service . findAll () ĊĊĠ Ġ@ GetMapping ("/ { id }") ĊĠ Ġfun Ġfind Post ById (@ PathVariable Ġid : ĠInt ): ĠPost Ġ= ĊĠĠĠ Ġthis . post Service . findById ( id ) Ċ Ċ } Ċ