package Ġde . de bu gle vel . br agi . chapter Ċ Ċ import Ġde . de bu gle vel . br agi . character . Character Service Ċ import Ġde . de bu gle vel . br agi . entity . Add Entity Response Ċ import Ġde . de bu gle vel . br agi . entity . Entity Controller Ċ import Ġde . de bu gle vel . br agi . entity . Update Entity Response Ċ import Ġde . de bu gle vel . br agi . places . Place Service Ċ import Ġio . mic ronaut . http . HttpResponse Ċ import Ġio . mic ronaut . http . annotation . Controller Ċ import Ġio . mic ronaut . http . annotation . Post Ċ import Ġio . mic ronaut . http . annotation . Put Ċ import Ġio . mic ronaut . security . annotation . Sec ured Ċ import Ġio . mic ronaut . security . rules . Security Rule Ċ import Ġio . swagger . v 3 . o as . annotations . tags . Tag Ċ import Ġmu . Kotlin Logging Ċ import Ġjava . util .* Ċ Ċ @ Sec ured ( Security Rule . IS _ AN ONY MO US ) Ċ @ Controller ("/ chapter s ") Ċ @ Tag ( name Ġ= Ġ" chapter s ") Ċ class ĠChapter Controller ( ĊĠĠĠ Ġprivate Ġval Ġchapter Service : ĠChapter Service , ĊĠĠĠ Ġprivate Ġval Ġplace Service : ĠPlace Service , ĊĠĠĠ Ġprivate Ġval Ġcharacter Service : ĠCharacter Service Ċ ) Ġ: ĠEntity Controller < Chapter >( chapter Service ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠKotlin Logging . logger Ġ{} ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Get Entity Response ( entity : ĠChapter ): ĠGet Chapter Response Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsuggested Characters Ġ= Ġcharacter Service . get Suggest ed ( entity . content Ġ+ Ġ" Ġ" Ġ+ Ġentity . summary ) ĊĠĠĠĠĠĠĠ Ġval Ġsuggested Places Ġ= Ġplace Service . get Suggest ed ( entity . content Ġ+ Ġ" Ġ" Ġ+ Ġentity . summary ) ĊĊĠĠĠĠĠĠĠ Ġval Ġget Entity Response Ġ= ĠGet Chapter Response ( entity ) ĊĠĠĠĠĠĠĠ Ġget Entity Response . suggest ed Characters . addAll ( suggest ed Characters . map Ġ{ Ġit . id !! Ġ}) ĊĠĠĠĠĠĠĠ Ġget Entity Response . suggest ed Places . addAll ( suggest ed Places . map Ġ{ Ġit . id !! Ġ}) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġget Entity Response ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Update Entity Response ( entity : ĠChapter ): ĠUpdate Chapter Response Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsuggested Characters Ġ= Ġcharacter Service . get Suggest ed ( entity . content ) ĊĠĠĠĠĠĠĠ Ġval Ġsuggested Places Ġ= Ġplace Service . get Suggest ed ( entity . content ) ĊĊĠĠĠĠĠĠĠ Ġval Ġget Entity Response Ġ= ĠUpdate Chapter Response ( entity ) ĊĠĠĠĠĠĠĠ Ġget Entity Response . suggest ed Characters . addAll ( suggest ed Characters . map Ġ{ Ġit . id !! Ġ}) ĊĠĠĠĠĠĠĠ Ġget Entity Response . suggest ed Places . addAll ( suggest ed Places . map Ġ{ Ġit . id !! Ġ}) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġget Entity Response ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Add Entity Response ( entity : ĠChapter ): ĠAdd Chapter Response Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠAdd Chapter Response ( entity ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠCreate Ġan Ġitem . ĊĠĠĠĠ Ġ* Ġ@ return ĠAn Ġitem ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Post ("/") ĊĠĠĠ Ġfun Ġpost One ( add Entity Request : ĠAdd Chapter Request ): ĠHttpResponse < Add Entity Response > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpost One Base ( add Entity Request ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠUpdate Ġan Ġentity . ĊĠĠĠĠ Ġ* Ġ@ param Ġuuid ĠID Ġof Ġthe Ġentity ĊĠĠĠĠ Ġ* Ġ@ return ĠThe Ġupdated Ġentity ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Put ("/ { uuid }") ĊĠĠĠ Ġfun Ġput One ( uuid : ĠUUID , Ġupdate Entity Request : ĠUpdate Chapter Request ): ĠHttpResponse < Update Entity Response > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġput One Base ( uuid , Ġupdate Entity Request ) ĊĠĠĠ Ġ} Ċ }