-
Notifications
You must be signed in to change notification settings - Fork 8
Sprint 1.2 UserController
Cyril Yared edited this page Nov 15, 2018
·
7 revisions
- User story:
- As an user, I would like to be able to create an account in order to use the application.
- HTTP mapping:
/api/user/create
- Returns
- success: "{role} {userName} created."
- fail: "{role} {userName} could not be created, select a new username and make sure your email has not been used before."
Parameters | Type | Description |
---|---|---|
username | String | user's username |
String | user's email adress | |
name | String | user's name |
role | String | passenger, driver, or administrator |
password | String | user's password |
- User story:
- As an user, I would like to update my profile so that I can change my credentials/role.
- http mapping:
/api/user/update
- Returns
- updated user
Parameters | Type | Description |
---|---|---|
username | String | user's username |
String | user's email adress | |
name | String | user's name |
role | String | passenger, driver, or administrator |
oldpass | String | user's password |
newpass | String | user's new password |
- User story:
- As a user, I would like to have my own private account so my information/history of trips remain confidential.
- http mapping:
/api/user/authenticate
- Returns
- user id: user can log in
- -1: user cannot log in
Parameters | Type | Description |
---|---|---|
username | String | user's username |
password | String | user's password |
- User story:
- As a user, I would like to have my own private account so my information/history of trips remain confidential.
- HTTP mapping:
/api/user/authorize
- Returns
- user id: user is authorized
- -1: user is not authorized
Parameters | Type | Description |
---|---|---|
username | String | user's username |
password | String | user's password |
role | String | user's role |
- User story:
- As a user, I would like to login and verify my role.
- HTTP mapping:
/api/user/login
- Returns
- role: user is authorized and has role
- empty string (""): user is not authorized
Parameters | Type | Description |
---|---|---|
username | String | user's username |
password | String | user's password |
- User story:
- As an administrator, I would like to find a user with their ID so I can manage things if needed.
- HTTP mapping:
/api/user/users/{id}
- Returns
- User object
Parameters | Type | Description |
---|---|---|
adminusername | String | Admin username |
adminpassword | String | Admin password |
id | int | ID's corresponding user |
- Note: The URL for an HTTP GET will look like this
https://rideshare08.herokuapp.com/api/user/users/1?adminusername=admin&adminpass=password
. This will retrieve user 1 with the admin username "admin" and the admin password "password."
- User story:
- As a administrator, I would like to find a user by certain attributes so that I can manage things if needed.
- HTTP mapping:
/api/user/find
- Returns
- a list of users
Parameters | Type | Description |
---|---|---|
adminusername | String | Admin username |
adminpassword | String | Admin password |
username | String | user's username |
password | String | user's password |
String | user's email address |
- User story:
- As an administrator, I would like to get the list of every user so I can manage things if needed.
- HTTP mapping:
/api/user/userlist
- Returns
- unfiltered list of users
Parameters | Type | Description |
---|---|---|
username | String | user's username |
password | String | user's password |
- User story:
- As an administrator, I would like to get the filtered list of top users so I can manage things if needed.
- HTTP mapping:
/api/trip/fuserlist
- Returns
- filtered list of users
Parameters | Type | Description |
---|---|---|
username | String | user's username |
password | String | user's password |