package Ġcom . hos omi . rest api . controller Ċ Ċ import Ġcom . hos omi . rest api . service . UserService Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation . RequestMapping Ċ import Ġorg . springframework . web . bind . annotation . Request Method Ċ import Ġorg . springframework . web . bind . annotation . RequestParam Ċ import Ġorg . springframework . web . bind . annotation . RestController ĊĊ Ċ @ RestController Ċ @ RequestMapping ("/ api ") Ċ class ĠSign up Controller Ġ{ ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġlateinit Ġvar ĠuserService : ĠUserService ĊĊĠĠĠ Ġ@ RequestMapping ( value Ġ= Ġ["/ signup "], Ġmethod Ġ= Ġ[( Request Method . POST )]) ĊĠĠĠ Ġfun Ġadd User (@ RequestParam Ġemail : ĠString , Ġ@ RequestParam Ġpassword : ĠString ): ĠResponseEntity < Long > Ġ= ĊĠĠĠĠĠĠĠ ĠuserService . createUser ( email , Ġpassword )?. let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠResponseEntity ( it . id , ĠHttpStatus . CREATED ) ĊĠĠĠĠĠĠĠ Ġ} Ġ?: ĠResponseEntity . status ( HttpStatus . CONF LI CT ). build () Ċ }