package Ġuk . gov . just ice . digital . as sess ments . controllers Ċ Ċ import Ġio . swagger . v 3 . o as . annotations . Operation Ċ import Ġio . swagger . v 3 . o as . annotations . responses . ApiResponse Ċ import Ġio . swagger . v 3 . o as . annotations . responses . Api Responses Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . security . access . pre post . Pre Authorize Ċ import Ġorg . springframework . stereotype . Controller Ċ import Ġorg . springframework . web . bind . annotation . PathVariable Ċ import Ġorg . springframework . web . bind . annotation . RequestMapping Ċ import Ġorg . springframework . web . bind . annotation . Request Method Ċ import Ġorg . springframework . web . bind . annotation . RequestParam Ċ import Ġorg . springframework . web . multipart . Multipart File Ċ import Ġuk . gov . just ice . digital . as sess ments . api . Uploaded Up w Document Dto Ċ import Ġuk . gov . just ice . digital . as sess ments . services . Document Service Ċ import Ġjava . util . UUID Ċ Ċ @ Controller Ċ class ĠDocument Controller ( val Ġdocument Service : ĠDocument Service ) Ġ{ ĊĊĠ Ġ@ RequestMapping ( ĊĠĠĠ Ġpath Ġ= Ġ["/ as sess ments /{ assessment Id }/ episode /{ episode Id }/ document "], Ġmethod Ġ= Ġ[ Request Method . POST ], ĊĠĠĠ Ġconsume s Ġ= Ġ[ MediaType . MULTI PART _ FORM _ DATA _ VALUE ] ĊĠ Ġ) ĊĠ Ġ@ Operation ( description Ġ= Ġ" Send Ġan ĠUn paid ĠWork Ġpdf Ġto ĠDel ius ") ĊĠ Ġ@ Api Responses ( ĊĠĠĠ Ġvalue Ġ= Ġ[ ĊĠĠĠĠĠ ĠApiResponse ( response Code Ġ= Ġ" 4 0 1 ", Ġdescription Ġ= Ġ" Invalid ĠJWT ĠToken "), ĊĠĠĠĠĠ ĠApiResponse ( response Code Ġ= Ġ" 2 0 0 ", Ġdescription Ġ= Ġ" OK ") ĊĠĠĠ Ġ] ĊĠ Ġ) ĊĠ Ġ@ Pre Authorize (" has Role (' ROLE _ PROB ATION ') ") ĊĠ Ġfun Ġupload UP W Document ( ĊĠĠĠ Ġ@ RequestParam (" file Data ") Ġfile Data : ĠMultip art File , ĊĠĠĠ Ġ@ PathVariable Ġepisode Id : ĠUUID , ĊĠĠĠ Ġ@ PathVariable Ġassessment Id : ĠUUID ĊĠ Ġ): ĠResponseEntity < Uploaded Up w Document Dto > Ġ{ ĊĠĠĠ Ġval Ġresponse Body Ġ= Ġdocument Service . upload Up w Document ( assessment Id , Ġepisode Id , Ġfile Data ) !! ĊĠĠĠ Ġreturn ĠResponseEntity ( response Body , ĠHttpStatus . OK ) ĊĠ Ġ} Ċ } Ċ