package Ġhu . never mind . demo . controller Ċ Ċ import Ġhu . never mind . demo . data . KeyValuePair Ċ import Ġhu . never mind . demo . data . KeyValuePair Repository Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . web . bind . annotation .* Ċ Ċ @ RestController Ċ class ĠKeyValuePair Controller ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġconstructor ( private Ġval Ġkey ValuePair Repository : ĠKeyValuePair Repository ) Ġ{ ĊĊĠĠĠ Ġ@ RequestMapping ("/ getKey Values ") ĊĠĠĠ Ġfun ĠgetKey Values (): ĠIterable < KeyValuePair > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġkey ValuePair Repository . findAll () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ RequestMapping ("/ getKey Value /{ key }") ĊĠĠĠ Ġfun Ġget KeyValue (@ PathVariable Ġkey : ĠString ): ĠKeyValuePair ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġkey ValuePair Repository . findOne ( key ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ RequestMapping ("/ save KeyValue ", Ġmethod = array Of ( Request Method . POST )) ĊĠĠĠ Ġfun Ġput KeyValue (@ RequestBody Ġentity : ĠKeyValuePair ): ĠKeyValuePair Ġ{ ĊĠĠĠĠĠĠĠ Ġkey ValuePair Repository . save ( entity ) ĊĠĠĠĠĠĠĠ Ġreturn Ġentity ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ RequestMapping ("/ delete KeyValue ", Ġmethod = array Of ( Request Method . POST )) ĊĠĠĠ Ġfun Ġdelete KeyValue (@ RequestBody Ġkey : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġkey ValuePair Repository . delete ( key ) ĊĠĠĠ Ġ} Ċ }