Class RegisterController
java.lang.Object
com.fredriksonsound.iot_backoffice_auth.endpoint.RegisterController
@RestController
public class RegisterController
extends java.lang.Object
Register endpoint
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRegisterController.RegisterCredentials -
Constructor Summary
Constructors Constructor Description RegisterController() -
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<com.google.gson.JsonObject>registerUser(RegisterController.RegisterCredentials credentials)
API doc:
Description: Creates a new user given user details
Method: POST
Location: /users
Body:
{
username: [username],
email: [email],
password: [password],
agency: [an_existing_agency]
}
Success response: {status: "ok"}, CODE: 201
Error response: {status: "error", message: [error_message]}
-
Constructor Details
-
RegisterController
public RegisterController()
-
-
Method Details
-
registerUser
@CrossOrigin(origins="*", allowedHeaders="*") @RequestMapping(value="/users", method=POST) public org.springframework.http.ResponseEntity<com.google.gson.JsonObject> registerUser(@RequestBody RegisterController.RegisterCredentials credentials)
API doc:
Description: Creates a new user given user details
Method: POST
Location: /users
Body:
{
username: [username],
email: [email],
password: [password],
agency: [an_existing_agency]
}
Success response: {status: "ok"}, CODE: 201
Error response: {status: "error", message: [error_message]}- Parameters:
credentials- the user to create- Returns:
- the location of the created user or error, error on invalid user
-