package Ġcom . d mit ren ko . db upload service . controller Ċ Ċ import Ġcom . d mit ren ko . db upload service . domain . security . User Ċ import Ġcom . d mit ren ko . db upload service . dto . security . User Add Request Ċ import Ġcom . d mit ren ko . db upload service . dto . security . UserRequest Ċ import Ġcom . d mit ren ko . db upload service . dto . security . UserRole Request Ċ import Ġcom . d mit ren ko . db upload service . dto . security . User Update Request Ċ import Ġcom . d mit ren ko . db upload service . service . security . UserService Ċ import Ġorg . springframework . http . HttpStatus .* Ċ import Ġorg . springframework . web . bind . annotation . PostMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestBody Ċ import Ġorg . springframework . web . bind . annotation . ResponseStatus Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ import Ġreactor . core . publisher . Flux Ċ import Ġreactor . core . publisher . Mono Ċ Ċ const Ġval ĠUSER _ ADD Ġ= Ġ" api / v 1 / security / user / add " Ċ const Ġval ĠUSER _ GET Ġ= Ġ" api / v 1 / security / user / get " Ċ const Ġval ĠUSER _ GET _ ALL Ġ= Ġ" api / v 1 / security / user / get - all " Ċ const Ġval ĠUSER _ UPDATE Ġ= Ġ" api / v 1 / security / user / update " Ċ const Ġval ĠUSER _ DELETE Ġ= Ġ" api / v 1 / security / user / delete " Ċ const Ġval ĠUSER _ ADD _ ROLE Ġ= Ġ" api / v 1 / security / user / add - role " Ċ const Ġval ĠUSER _ DELETE _ ROLE Ġ= Ġ" api / v 1 / security / user / delete - role " Ċ Ċ @ RestController Ċ class ĠUser Controller ( Ċĉ ĉ private Ġval Ġservice : ĠUserService Ċ ) Ġ{ ĊĊ ĉ @ ResponseStatus ( CREATED ) Ċ ĉ @ PostMapping ( USER _ ADD ) Ċ ĉ fun Ġadd (@ RequestBody Ġrequest : ĠUser Add Request ): ĠMono < User > Ġ= Ġservice . add ( request ) ĊĊ ĉ @ PostMapping ( USER _ GET ) Ċ ĉ fun Ġget (@ RequestBody Ġrequest : ĠUser Request ): ĠMono < User > Ġ= Ġservice . get ( request ) ĊĊ ĉ @ PostMapping ( USER _ GET _ ALL ) Ċ ĉ fun ĠgetAll (): ĠFlux < User > Ġ= Ġservice . getAll () ĊĊ ĉ @ ResponseStatus ( OK ) Ċ ĉ @ PostMapping ( USER _ UPDATE ) Ċ ĉ fun Ġupdate (@ RequestBody Ġrequest : ĠUser Update Request ): ĠMono < User > Ġ= Ġservice . update ( request ) ĊĊ ĉ @ ResponseStatus ( NO _ CONTENT ) Ċ ĉ @ PostMapping ( USER _ DELETE ) Ċ ĉ fun Ġdelete (@ RequestBody Ġrequest : ĠUser Request ): ĠMono < Void > Ġ= Ġservice . delete ( request ) ĊĊ ĉ @ ResponseStatus ( OK ) Ċ ĉ @ PostMapping ( USER _ ADD _ ROLE ) Ċ ĉ fun Ġadd Role (@ RequestBody Ġrequest : ĠUser Role Request ): ĠMono < User > Ġ= Ġservice . add Role ( request ) ĊĊ ĉ @ ResponseStatus ( OK ) Ċ ĉ @ PostMapping ( USER _ DELETE _ ROLE ) Ċ ĉ fun Ġdelete Role (@ RequestBody Ġrequest : ĠUser Role Request ): ĠMono < User > Ġ= Ġservice . delete Role ( request ) Ċ } ĊĊ