package Ġwild . monitor . jobs . web Ċ Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . http . Response Entity . ok Ċ import Ġorg . springframework . web . bind . annotation . Patch Mapping Ċ import Ġorg . springframework . web . bind . annotation . PathVariable Ċ import Ġorg . springframework . web . bind . annotation . RequestBody Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ import Ġwild . monitor . jobs . Job Repository Ċ import Ġwild . monitor . jobs . JobStatus Ċ import Ġwild . monitor . jobs . Update JobStatus UseCase Ċ import Ġjava . util .* Ċ Ċ @ RestController Ċ class ĠUpdate JobStatus Controller ( private Ġval Ġupdate JobStatus UseCase : ĠUpdate JobStatus UseCase , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprivate Ġval Ġjob Repository : ĠJob Repository ) Ġ{ ĊĠĠĠ Ġ@ Patch Mapping ("/ jobs /{ jobId }", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconsume s Ġ= Ġ[ MediaType . APPLICATION _ JSON _ UTF 8 _ VALUE ], ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproduces Ġ= Ġ[ MediaType . APPLICATION _ JSON _ UTF 8 _ VALUE ]) ĊĠĠĠ Ġfun Ġupdate JobStatus (@ PathVariable (" jobId ") Ġjob Id : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ RequestBody Ġjob Status Request : ĠUpdate JobStatus Request ): ĠResponseEntity < Job Response > Ġ{ ĊĠĠĠĠĠĠĠ Ġupdate JobStatus UseCase . update JobStatus ( jobId , ĠJob Status . valueOf ( job Status Request . new Status )) ĊĠĠĠĠĠĠĠ Ġreturn Ġok ( Job Response . from Group ed Jobs ( job Repository . findBy JobId ( UUID . fromString ( jobId )))) ĊĠĠĠ Ġ} Ċ }