package Ġorg . mig or . rss . rich . api Ċ Ċ import Ġorg . mig or . rss . rich . api . dto . Article Json Dto Ċ import Ġorg . mig or . rss . rich . service . Feed Service Ċ import Ġorg . mig or . rss . rich . service . Stream Service Ċ import Ġorg . mig or . rss . rich . util . Feed Exporter Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . stereotype . Controller Ċ import Ġorg . springframework . web . bind . annotation .* ĊĊ Ċ @ Controller Ċ class ĠStream Controller Ġ{ ĊĊĠ Ġ@ Autowired ĊĠ Ġlateinit Ġvar Ġfeed Service : ĠFeed Service ĊĊĠ Ġ@ Autowired ĊĠ Ġlateinit Ġvar Ġstream Service : ĠStream Service ĊĊĠ Ġ@ GetMapping ("/ stream :{ stream Id }/ rss ", Ġproduces Ġ= Ġ[" application / rss + xml ; charset = UTF - 8 "]) ĊĠ Ġfun Ġr ss Feed (@ PathVariable (" stream Id ") Ġstream Id : ĠString ): ĠResponseEntity < String > Ġ{ ĊĠĠĠ Ġreturn ĠFeed Exporter . to R ss ( feed Service . findBy Stream Id ( stream Id )) ĊĠ Ġ} ĊĊĠ Ġ@ GetMapping ("/ stream :{ stream Id }", Ġ"/ stream :{ stream Id }/ atom ", Ġproduces Ġ= Ġ[" application / atom + xml ; charset = UTF - 8 "]) ĊĠ Ġfun Ġatom Feed (@ PathVariable (" stream Id ") Ġstream Id : ĠString ): ĠResponseEntity < String > Ġ{ ĊĠĠĠ Ġreturn ĠFeed Exporter . to Atom ( feed Service . findBy Stream Id ( stream Id )) ĊĠ Ġ} ĊĊĠ Ġ@ GetMapping ("/ stream :{ stream Id }/ json ", Ġproduces Ġ= Ġ[" application / json ; charset = UTF - 8 "]) ĊĠ Ġfun Ġjson Feed (@ PathVariable (" stream Id ") Ġstream Id : ĠString ): ĠResponseEntity < String > Ġ{ ĊĠĠĠ Ġreturn ĠFeed Exporter . toJson ( feed Service . findBy Stream Id ( stream Id )) ĊĠ Ġ} ĊĊĠ Ġ@ Put Mapping ("/ stream :{ stream Id }/ put ") ĊĠ Ġfun ĠaddTo Feed (@ PathVariable (" stream Id ") Ġstream Id : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ RequestParam (" token ") Ġtoken : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ RequestBody Ġarticle : ĠArticle Json Dto ) Ġ{ ĊĠĠĠ Ġreturn Ġstream Service . addTo Stream ( stream Id , Ġarticle , Ġtoken ) ĊĠ Ġ} ĊĊĠ Ġ@ Delete Mapping ("/ stream :{ stream Id }/ delete ") ĊĠ Ġfun Ġdelete From Feed (@ PathVariable (" stream Id ") Ġstream Id : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ RequestParam (" article ") Ġarticle Id : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ RequestParam (" token ") Ġtoken : ĠString ) Ġ{ ĊĠĠĠ Ġreturn Ġstream Service . delete From t ream ( stream Id , Ġarticle Id , Ġtoken ) ĊĠ Ġ} Ċ Ċ } Ċ