-
Notifications
You must be signed in to change notification settings - Fork 6
Documentation of REST Methods
liutianci1887 edited this page Nov 17, 2019
·
30 revisions
Below is a documented list of REST Methods that we developed. All the methods will be specified through the controller methods.
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
GET | /applications |
- | get array of all applications |
GET | /applications/{input} |
input | get corresponding application by id or email |
POST | /applications/create |
existing, name, email, courses | creates an application. Parameter exisiting checks whether or not tutor is already in system |
DELETE | /applications/{input} |
input | deletes corresponding application by id or email |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /login |
email, password | login, returns the person object dto or null if invalid |
POST | /accept/{id} |
id | accepts request by request id |
POST | /reject/{id} |
id | rejects request by request id |
POST | /flushdb |
clears the database |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
GET | /courses |
- | get array of all courses |
GET | /courses/subject/{subject} |
subject | get array of all courses with subject name |
GET | /courses/institution/{institution} |
institution | get array of all courses with institution name |
GET | /courses/{course} |
course | get corresponding course with course name |
POST | /courses/create |
name, institution, subject | creates course |
DELETE | /courses/{course} |
course | deletes corresponding course with course name |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
GET | /institutions |
- | get array of all institutions |
GET | /institutions/{name} |
name | get corresponding institution by institution name |
DELETE | /institutions/{name} |
name | deletes corresponding institution by institution name |
POST | /institutions/create |
name, level | creates corresponding institution |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /managers/create |
name, email, password | creates manager |
GET | /managers/{id} |
id | get corresponding manager by user id |
GET | /managers/email/{email} |
get corresponding manager by email | |
DELETE | /managers/{input} |
input | deletes corresponding manager by user id or email |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
GET | /notifications/{id} |
id | get corresponding notification by id |
GET | /notifications/tutor/{id} |
id | get array of all tutor's notifications |
GET | /notifications |
- | get array of all notifications |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /requests/create |
date, time, tutorId, studentId, courseName | creates request |
GET | /requests/{id} |
id | get corresponding request by id |
GET | /requests |
- | get all requests |
GET | /requests/tutor/{id} |
id | get array of all requests by tutor user id |
GET | /requests/accepted/{id} |
id | get array of all accepted tutor requests by tutor user id |
DELETE | /requests/{id} |
id | deletes corresponding request by id |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /reviews/create |
rating, comment, from, to | creates review |
GET | /reviews/{id} |
id | get review by id |
GET | /reviews/tutor/{id} |
id | get array of reviews by tutor id |
DELETE | /reviews/{id} |
id | deletes corresponding review by id |
GET | /reviews |
- | get array of all reviews |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /rooms/create |
id, capacity | creates room |
GET | /rooms/{id} |
id | get corresponding room by room number (id) |
DELETE | /rooms/{id} |
id | deletes corresponding room by room number (id) |
GET | /rooms |
- | get array of all rooms |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /students/create |
name, email, password | creates student |
GET | /students/{id} |
id | get corresponding student by user id |
GET | /students/email/{email} |
returns corresponding student by email | |
GET | /students |
- | get array of all students |
DELETE | /students{input} |
input | deletes corresponding student by user id or email |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /timeslots/create |
id, date, time | creates time slot |
GET | /timeslots/{id} |
id | get corresponding time slot by id |
GET | /timeslots/tutor/{id} |
id | get array of time slots by tutor id |
DELETE | /timeslots/{id} |
id | deletes time slot by id |
GET | /timeslots/{date}/{time} |
date | returns array of all time slots by date and time |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /tutors/create |
name, email, password | creates tutor |
GET | /tutors/{id} |
id | get corresponding tutor by user id |
GET | /tutors/email/{email} |
get corresponding tutor by email | |
DELETE | /tutors/{input} |
input | deletes corresponding tutor by user id or email |
GET | /tutors |
- | get array of all tutors |
PUT | /tutors/update/{id} |
id, password, name, timeslots, wage | changes tutor settings |
Request Type | Endpoints | Inputs | Function |
---|---|---|---|
POST | /wages/create |
tutorId, course, wage | creates wage |
GET | /wages/{id} |
id | get corresponding wage by id |
DELETE | /wages/{id} |
id | deletes corresponding wage by id |
GET | /wages |
- | get array of all wages |
GET | /wages/tutor/{tutor} |
tutor | get array of all wages by tutor |
GET | /wages/course/{course} |
course | get array of all wages by course |
PUT | /wages/update/{id} |
id, wage | updates wage amount by wage id |
Group 14 LUU Steven, ZENG Nelson, LIU Tian Ci, AMMAR Mehdi, GURKAN Mert