package Ġcom . q ing zh u . staff admin . staff . controller Ċ Ċ import Ġcom . q ing zh u . common . security . body To Mono With Org And Staff Ċ import Ġcom . q ing zh u . common . security . get Principal Triple Ċ import Ġcom . q ing zh u . staff admin . staff . domain . entity . Quick Reply Ċ import Ġcom . q ing zh u . staff admin . staff . domain . entity . Quick Reply Group Ċ import Ġcom . q ing zh u . staff admin . staff . service . Quick Reply Service Ċ import Ġkotlinx . coroutines . reactive . await Single Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ 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 . Server Response . ok Ċ import Ġorg . springframework . web . reactive . function . server . body Ċ Ċ @ RestController Ċ class ĠQuick Reply Handler ( ĊĠĠĠ Ġprivate Ġval Ġquick Reply Service : ĠQuick Reply Service , Ċ ) Ġ{ ĊĠĠĠ Ġsuspend Ġfun Ġfind Quick Reply By Staff ( sr : ĠServer Request ): ĠServer Response Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsr ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. principal () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. get Principal Triple () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Ġ{ Ġquick Reply Service . find Quick Reply By Staff ( it . t 1 , Ġit . t 2 ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. transform Ġ{ Ġok (). body ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. await Single () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġfind Quick Reply By Organization Id ( sr : ĠServer Request ): ĠServer Response Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsr ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. principal () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. get Principal Triple () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Ġ{ Ġquick Reply Service . find Quick Reply By Organization Id ( it . t 1 ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. transform Ġ{ Ġok (). body ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. await Single () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġsave Quick Reply ( sr : ĠServer Request ): ĠServer Response Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsr . body To Mono With Org And Staff < Quick Reply >() ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Ġ{ Ġquick Reply Service . save Quick Reply ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. transform Ġ{ Ġok (). body ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. await Single () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġsave Quick Reply Group ( sr : ĠServer Request ): ĠServer Response Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsr . body To Mono With Org And Staff < Quick Reply Group >() ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Ġ{ Ġquick Reply Service . save Quick Reply Group ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. transform Ġ{ Ġok (). body ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. await Single () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġdelete Quick Reply ( sr : ĠServer Request ): ĠServer Response Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġid Ġ= Ġsr . path Variable (" id "). to Long () ĊĠĠĠĠĠĠĠ Ġreturn Ġquick Reply Service . delete Quick Reply ( id ). then ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġok (). build () ĊĠĠĠĠĠĠĠ Ġ). await Single () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġdelete Quick Reply Group ( sr : ĠServer Request ): ĠServer Response Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġid Ġ= Ġsr . path Variable (" id "). to Long () ĊĠĠĠĠĠĠĠ Ġreturn Ġquick Reply Service . delete Quick Reply Group ( id ). then ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġok (). build () ĊĠĠĠĠĠĠĠ Ġ). await Single () ĊĠĠĠ Ġ} Ċ }