package Ġcom . ch im ber . de bt isl av . controller Ċ Ċ import Ġcom . ch im ber . de bt isl av . dto . Registration Request Ċ import Ġcom . ch im ber . de bt isl av . service . Registration Service Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation . PostMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestBody Ċ import Ġorg . springframework . web . bind . annotation . RequestMapping Ċ import Ġorg . springframework . web . bind . annotation . RestController ĊĊ Ċ @ RestController Ċ @ RequestMapping ("/ registration ") Ċ class ĠRegistration Controller ( private Ġval Ġregistration Service : ĠRegistration Service ) Ġ{ ĊĠĠĠ Ġ@ PostMapping ĊĠĠĠ Ġfun Ġregister (@ RequestBody Ġrequest : ĠRegistration Request ): ĠResponseEntity < String > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġregistration Service . register ( request ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠResponseEntity (" Registration Ġsuccessful ", ĠHttpStatus . OK ) ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠIllegalStateException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠResponseEntity (" Registration Ġfailed : Ġ${ e . message }", ĠHttpStatus . CONF LI CT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ