@@ -58,6 +58,7 @@ public UserController(UserService userService, PasswordEncoder passwordEncoder,
5858
5959
6060 @ PostMapping ("/signup" )
61+ @ Operation (summary = "Create new client-user" )
6162 public ResponseEntity <?> signup (@ RequestBody AppClientSignUpDto user ){
6263 System .out .println (user );
6364
@@ -71,6 +72,7 @@ public ResponseEntity<?> signup(@RequestBody AppClientSignUpDto user){
7172
7273
7374 @ PostMapping ("/register" )
75+ @ Operation (summary = "Create new business-user" )
7476 public ResponseEntity <?> registerBusiness (@ RequestBody BusinessRegisterDto business ){
7577
7678 if (this .userService .businessExists (business .getBusinessName () ) || this .userService .userExists (business .getUsername (), business .getEmail ())){
@@ -86,20 +88,20 @@ public ResponseEntity<?> registerBusiness(@RequestBody BusinessRegisterDto busin
8688
8789
8890 @ GetMapping ("/client" )
89- @ Operation (summary = "My endpoint " , security = @ SecurityRequirement (name = "bearerAuth" ))
91+ @ Operation (summary = "show client-user information " , security = @ SecurityRequirement (name = "bearerAuth" ))
9092 public AppClient showUserDetails (@ RequestParam String username ) {
9193 return this .userService .findAppClientByUsername (username );
9294 }
9395
9496
9597 @ GetMapping ("/business" )
96- @ Operation (summary = "My endpoint " , security = @ SecurityRequirement (name = "bearerAuth" ))
98+ @ Operation (summary = "Show business-user information " , security = @ SecurityRequirement (name = "bearerAuth" ))
9799 public BusinessOwner showBusinessDetails (@ RequestParam String username ) {
98100 return this .userService .findBusinessByUsername (username );
99101 }
100102
101103 @ PutMapping ("/user" )
102- @ Operation (summary = "My endpoint " , security = @ SecurityRequirement (name = "bearerAuth" ))
104+ @ Operation (summary = "Update client-user information (use existing user id) " , security = @ SecurityRequirement (name = "bearerAuth" ))
103105 public ResponseEntity <?> updateUser (@ RequestBody UpdateAppClientDto user ) {
104106
105107 AppClient client = this .userService .findAppClientById (user .getId ());
@@ -113,7 +115,7 @@ public ResponseEntity<?> updateUser(@RequestBody UpdateAppClientDto user) {
113115
114116 }
115117 @ PostMapping ("/notification" )
116- @ Operation (summary = "My endpoint " , security = @ SecurityRequirement (name = "bearerAuth" ))
118+ @ Operation (summary = "Send notification with password reset link " , security = @ SecurityRequirement (name = "bearerAuth" ))
117119 public ResponseEntity <?> sendNotification (@ RequestParam ("email" ) String e ) {
118120 UserEntity userByEmail = this .userService .findUserByEmail (e );
119121
@@ -125,8 +127,8 @@ public ResponseEntity<?> sendNotification(@RequestParam("email") String e) {
125127 }
126128 return new ResponseEntity <>(userByEmail , HttpStatus .OK );
127129 }
128- @ PostMapping ("/password" )
129- @ Operation (summary = "My endpoint " , security = @ SecurityRequirement (name = "bearerAuth" ))
130+ @ PutMapping ("/password" )
131+ @ Operation (summary = "Update password, (use existing user id) " , security = @ SecurityRequirement (name = "bearerAuth" ))
130132 public ResponseEntity <?> setUpNewPassword (@ RequestParam Long id , String password ) {
131133 UserEntity userById = this .userService .findUserById (id );
132134 userById .setPassword (this .passwordEncoder .encode (password ));
@@ -135,7 +137,7 @@ public ResponseEntity<?> setUpNewPassword(@RequestParam Long id, String passwor
135137 }
136138
137139 @ PutMapping ("/business" )
138- @ Operation (summary = "My endpoint " , security = @ SecurityRequirement (name = "bearerAuth" ))
140+ @ Operation (summary = "Update business-user, (use existing user id) " , security = @ SecurityRequirement (name = "bearerAuth" ))
139141 public ResponseEntity <?> updateBusiness (@ RequestBody UpdateBusinessDto business ) {
140142
141143 BusinessOwner businessOwner = this .userService .findBusinessOwnerById (business .getId ());
@@ -151,7 +153,7 @@ public ResponseEntity<?> updateBusiness(@RequestBody UpdateBusinessDto business
151153
152154 }
153155 @ DeleteMapping ("/user/{id}" )
154- @ Operation (summary = "My endpoint " , security = @ SecurityRequirement (name = "bearerAuth" ))
156+ @ Operation (summary = "Delete user " , security = @ SecurityRequirement (name = "bearerAuth" ))
155157 public ResponseEntity <Long > deleteUser (@ PathVariable Long id ){
156158
157159 boolean isRemoved = this .userService .deleteUser (id );
@@ -163,6 +165,7 @@ public ResponseEntity<Long> deleteUser(@PathVariable Long id){
163165 }
164166
165167 @ PostMapping ("/authenticate" )
168+ @ Operation (summary = "Authenticate user and get JWT Token" )
166169 public JwtResponse authenticate (@ RequestBody JwtRequest jwtRequest ) throws Exception {
167170
168171 try {
@@ -188,7 +191,7 @@ public JwtResponse authenticate(@RequestBody JwtRequest jwtRequest) throws Excep
188191
189192 @ PostMapping ("/login" )
190193 @ CrossOrigin (origins = "http://localhost:4200" )
191- @ Operation (summary = "My endpoint " , security = @ SecurityRequirement (name = "bearerAuth" ))
194+ @ Operation (summary = "Login based on user role after authentication " , security = @ SecurityRequirement (name = "bearerAuth" ))
192195 public String logInUser (@ RequestParam String username ){
193196 UserEntity userByUsername = this .userService .findUserByUsername (username );
194197 if (userByUsername .getRoles ().stream ()
0 commit comments