package Ġcom . seed company . cord tables . components . tables . up . pr ayer _ notifications Ċ Ċ import Ġcom . seed company . cord tables . components . tables . up . pr ayer _ notifications . Delete Ġas ĠCommon Delete Ċ import Ġcom . seed company . cord tables . common . ErrorType Ċ import Ġcom . seed company . cord tables . common . Utility Ċ import Ġcom . seed company . cord tables . components . tables . up . pr ayer _ notifications . Up Pr ayer Notifications Delete Request Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . stereotype . Controller Ċ import Ġorg . springframework . web . bind . annotation . Cross Origin Ċ import Ġorg . springframework . web . bind . annotation . PostMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestBody Ċ import Ġorg . springframework . web . bind . annotation . ResponseBody Ċ import Ġjava . sql . SQLException Ċ import Ġjavax . sql . DataSource Ċ Ċ data Ġclass ĠUp Pr ayer Notifications Delete Request ( ĊĠĠĠ Ġval Ġid : ĠString , ĊĠĠĠ Ġval Ġtoken : ĠString ?, Ċ ) Ċ Ċ data Ġclass ĠUp Pr ayer Notifications Delete Response ( ĊĠĠĠ Ġval Ġerror : ĠError Type , ĊĠĠĠ Ġval Ġid : ĠString ? Ċ ) Ċ Ċ @ Cross Origin ( orig ins Ġ= Ġ[" http :// localhost : 3 3 3 3 ", Ġ" https :// dev . cord tables . com ", Ġ" https :// cord tables . com ", Ġ"* "]) Ċ @ Controller (" Up Pr ayer Notifications Delete ") Ċ class ĠDelete ( ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġval Ġutil : ĠUtility , ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġval Ġds : ĠDataSource , Ċ ) Ġ{ ĊĠĠĠ Ġ@ PostMapping (" up / pr ayer - notifications / delete ") ĊĠĠĠ Ġ@ ResponseBody ĊĠĠĠ Ġfun Ġdelete Handler (@ RequestBody Ġreq : ĠUp Pr ayer Notifications Delete Request ): ĠUp Pr ayer Notifications Delete Response Ġ{ ĊĊĠĠĠĠĠĠĠ Ġif Ġ( req . token Ġ== Ġnull ) Ġreturn ĠUp Pr ayer Notifications Delete Response ( ErrorType . Token NotFound , Ġnull ) ĊĠĠĠĠĠĠĠ Ġif (! util . user Has Delete Permission ( req . token , Ġ" up . pr ayer _ notifications ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠUp Pr ayer Notifications Delete Response ( ErrorType . DoesNot Have Delete Permission , Ġnull ) ĊĊĠĠĠĠĠĠĠ Ġprintln (" req : Ġ$ req ") ĊĠĠĠĠĠĠĠ Ġvar Ġdeleted Location Ex Id : ĠString ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġthis . ds . connection . use Ġ{ Ġconn Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġdelete Statement Ġ= Ġconn . prepare Call ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" delete Ġfrom Ġup . pr ayer _ notifications Ġwhere Ġid Ġ= Ġ? Ġreturning Ġid " ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdelete Statement . setString ( 1 , Ġreq . id ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġdelete Statement Result Ġ= Ġdelete Statement . executeQuery () ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( delete Statement Result . next ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdeleted Location Ex Id Ġ Ġ= Ġdelete Statement Result . getString (" id ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcatch Ġ( e : SQLException Ġ){ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprintln ( e . message ) ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠUp Pr ayer Notifications Delete Response ( ErrorType . SQL Delete Error , Ġnull ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn ĠUp Pr ayer Notifications Delete Response ( ErrorType . NoError , deleted Location Ex Id ) ĊĠĠĠ Ġ} Ċ } Ċ