package Ġcom . dm all cott . example Ċ Ċ import Ġcom . dm all cott . aud itor . Aud itor Ċ import Ġcom . dm all cott . aud itor . model . Change log Item Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . Patch Mapping Ċ import Ġorg . springframework . web . bind . annotation . PostMapping Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ import Ġjava . util .* Ċ import Ġkotlin . random . Random ĊĊ Ċ @ RestController Ċ class ĠTest Controller Ġ{ ĊĊĠĠĠ Ġ@ Autowired Ġlateinit Ġvar Ġaud itor : ĠAud itor ĊĊĠĠĠ Ġprivate Ġval Ġquote Ġ= ĠQuote ( Quote Id ( UUID . randomUUID (). toString ()), Ġ 1 0 . 0 , Ġ" GBP ", Ġrandom Currency ()) ĊĠĠĠ Ġprivate Ġfinal Ġfun Ġrandom Currency () Ġ= ĠlistOf (" GBP ", Ġ" EUR ", Ġ" USD ", Ġ" CAD ", Ġ" NZ D "). random () ĊĠĠĠ Ġprivate Ġfinal Ġfun Ġrandom Profile () Ġ= ĠRandom . next Long ( 0 , Ġ 1 0 0 0 0 0 ). toString () ĊĠĠĠ Ġprivate Ġfinal Ġfun Ġrandom Amount () Ġ= ĠRandom . next Double ( 0 . 0 , Ġ 2 0 0 0 0 0 . 0 ) ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ["/ get "], Ġproduces Ġ= Ġ[" application / json "]) ĊĠĠĠ Ġfun Ġget () Ġ: ĠResponseEntity < List < Change log Item < Quote >>> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok (). body ( aud itor . get Change log ( quote . id , ĠQuote :: class . java )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ PostMapping ( value Ġ= Ġ["/ create "]) ĊĠĠĠ Ġfun Ġcreate () Ġ: ĠResponseEntity < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġaud itor . log ( quote . id , Ġquote , Ġrandom Profile ()) ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok (). build () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Patch Mapping ( value Ġ= Ġ["/ update "], Ġproduces Ġ= Ġ[" application / json "]) ĊĠĠĠ Ġfun Ġupdate () Ġ: ĠResponseEntity < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġaud itor . log ( quote . id , Ġquote . copy ( amount Ġ= Ġrandom Amount ()), Ġrandom Profile ()) ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok (). build () ĊĠĠĠ Ġ} Ċ }