package Ġfi . ard ento . easy ch ords . mid iser ver . controllers Ċ Ċ import Ġfi . ard ento . easy ch ords . mid iser ver . services . Midi Device Ċ import Ġfi . ard ento . easy ch ords . mid iser ver . services . Midi Service Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation .* Ċ Ċ @ RestController Ċ @ RequestMapping ("/ devices ") Ċ @ Cross Origin ( orig ins Ġ= Ġ[" http :// localhost : 3 0 0 0 ", Ġ" https :// easy - ch ords . io "]) Ċ class ĠDevice Controller ( ĊĠĠĠ Ġprivate Ġval Ġmidi Service : ĠM idi Service Ċ ) Ġ{ ĊĠĠĠ Ġ@ GetMapping ĊĠĠĠ Ġfun Ġget Devices (): ĠResponseEntity < List < Midi Device >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġmidi Service . get Devices (). let Ġ{ ĠResponseEntity . ok ( it ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Put Mapping ĊĠĠĠ Ġfun Ġset Device ( ĊĠĠĠĠĠĠĠ Ġ@ RequestBody Ġdevice : ĠM idi Device ĊĠĠĠ Ġ): ĠResponseEntity < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġmidi Service . set Midi Receiver ( device ) ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . no Content (). build () ĊĠĠĠ Ġ} Ċ Ċ } Ċ