package Ġorg . open ap it ools . api Ċ Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . http . Response Entity Ċ Ċ import Ġorg . springframework . web . bind . annotation .* Ċ import Ġorg . springframework . validation . annotation . Validated Ċ import Ġorg . springframework . web . context . request . Native WebRequest Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ Ċ import Ġjavax . validation . Valid Ċ import Ġjavax . validation . constraints . Decimal Max Ċ import Ġjavax . validation . constraints . Decimal Min Ċ import Ġjavax . validation . constraints . Max Ċ import Ġjavax . validation . constraints . Min Ċ import Ġjavax . validation . constraints . NotNull Ċ import Ġjavax . validation . constraints . Pattern Ċ import Ġjavax . validation . constraints . Size Ċ Ċ import Ġkotlin . collections . List Ċ import Ġkotlin . collections . Map Ċ Ċ @ RestController Ċ @ Validated Ċ @ RequestMapping ("\ ${ api . base - path : }") Ċ class ĠCreate Item Api Controller () Ġ{ ĊĊĊĠĠĠ Ġ@ RequestMapping ( ĊĠĠĠĠĠĠĠ Ġmethod Ġ= Ġ[ Request Method . POST ], ĊĠĠĠĠĠĠĠ Ġvalue Ġ= Ġ["/ create Item "], ĊĠĠĠĠĠĠĠ Ġproduces Ġ= Ġ[" * /* "], ĊĠĠĠĠĠĠĠ Ġconsume s Ġ= Ġ[" application / json "] ĊĠĠĠ Ġ) ĊĠĠĠ Ġfun Ġpost Create Item (@ NotNull Ġ Ġ@ RequestParam ( value Ġ= Ġ" name ", Ġrequired Ġ= Ġtrue ) Ġname : Ġkotlin . String Ċ , Ġ@ RequestParam ( value Ġ= Ġ" from ", Ġrequired Ġ= Ġfalse ) Ġfrom : Ġkotlin . String ? Ċ , Ġ@ RequestParam ( value Ġ= Ġ" mode ", Ġrequired Ġ= Ġfalse ) Ġmode : Ġkotlin . String ? Ċ , Ġ@ Request Header ( value =" J enkins - Cr umb ", Ġrequired = false ) Ġjenkins Cr umb : Ġkotlin . String ? Ċ , Ġ@ Request Header ( value =" Content - Type ", Ġrequired = false ) ĠcontentType : Ġkotlin . String ? Ċ , Ġ@ Valid Ġ@ RequestBody ( required Ġ= Ġfalse ) Ġbody : Ġkotlin . String ? Ċ ): ĠResponseEntity < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity ( HttpStatus . NOT _ IMPLEMENTED ) ĊĠĠĠ Ġ} Ċ } Ċ