package Ġs ios io . multi pler 2 dbc . db 1 Ċ Ċ import Ġkotlinx . coroutines . reactive . await Single Ċ import Ġorg . springframework . data . annotation . Id Ċ import Ġorg . springframework . data . domain . Persist able Ċ import Ġorg . springframework . data . repository . reactive . Reactive Crud Repository Ċ import Ġorg . springframework . stereotype . Component Ċ import Ġorg . springframework . stereotype . Repository Ċ import Ġorg . springframework . web . reactive . function . server . Server Request Ċ import Ġorg . springframework . web . reactive . function . server . Server Response Ċ import Ġorg . springframework . web . reactive . function . server . body Value And Await Ċ import Ġjava . util . UUID Ċ Ċ @ Component Ċ class ĠDb 1 Handler ( private Ġval Ġho ge Repository : ĠHo ge Repository ) Ġ{ ĊĠĠĠ Ġsuspend Ġfun Ġpost ( request : ĠServer Request ) Ġ: ĠServer Response Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġho ge Ġ= Ġho ge Repository . save ( Ho ge ( UUID . randomUUID (). toString (), Ġ" ho ge ")). await Single () ĊĠĠĠĠĠĠĠ Ġreturn ĠServer Response . ok (). body Value And Await ( map Of (" id " Ġto Ġho ge . id )) ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ Repository Ċ interface ĠHo ge Repository : ĠReactive Crud Repository < Ho ge , ĠString > Ċ Ċ // create Ġtable Ġho ge Ġ( id Ġchar ( 3 6 ) Ġnot Ġnull , Ġname Ġvarchar ( 1 0 0 ), Ġprimary Ġkey ( id )) Ċ data Ġclass ĠHo ge ( ĊĠĠĠ Ġ@ Id Ġprivate Ġval Ġid : ĠString , ĊĠĠĠ Ġval Ġname : ĠString Ċ ) Ġ: ĠPers ist able < String > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġis New (): ĠBoolean Ġ= Ġtrue ĊĠĠĠ Ġoverride Ġfun ĠgetId () Ġ= Ġid Ċ } ĊĊ