Skip to content

Restful Services Endpoints

Zheng Yu Cui edited this page Nov 2, 2019 · 44 revisions

R1: Register New Student

To register a new student, use the following endpoint,
Post Mapping: http://localhost:8080/student/{username}/{password}/{name}

  • @PathVariable : username
  • @PathVariable : password
  • @PathVariable : name

To view all the students registered, use the following endpoint,
Get Mapping: http://localhost:8080/students/

R2: Student Log-In

To log in student, use the following endpoint,
Post Mapping: http://localhost:8080/student/{username}/{password}

  • @PathVariable : username
  • @PathVariable : password

To log out, use the following endpoint,
Put Mapping: http://localhost:8080/logout

R3: Search Using Course Number

To view all the courses offered by the system, use the following endpoint,
Get Mapping: http://localhost:8080/courses

To search for courses using course number, use the following endpoint,
Get Mapping: http://localhost:8080/courses/{code}

  • @PathVariable : code

The following post mappings were implemented to check if the get mappings work

To add a university to the system,
Post Mapping: http://localhost:8080/university/{id}/{name}

  • @PathVariable : id
  • @PathVariable : name

To add a course to the system,
Post Mapping: http://localhost:8080/course/{code}/{UniversityName}/{subject}

  • @PathVariable : code
  • @PathVariable : UniversityName
  • @PathVariable : subject

R4: Search Using University Name

To view all the universities offered by the system, use the following endpoint,
Get Mapping: http://localhost:8080/universities

To search for all the courses offered by a specific university, use the following endpoint
Get Mapping: http://localhost:8080/courses/university

  • @PathVariable : university

(Note: university is a string for the university name)

R5: Search Using Subject Category

To search for courses using the subject category, use the following endpoint,
Get Mapping: http://localhost:8080/courses/subject/{sub}

  • @PathVariable: sub

R6: Tutor Profile

To list all available tutors along with their information for the selected course, use the following endpoint,
Get Mapping: http://localhost:8080/courses/tutors/{courseCode}

  • @PathVariable: courseCode

R7: Request New Course

If the course does not exist, a student may request said course to be tutored. To do so use the following endpoint,
Post Mapping: http://localhost:8080/course/request/{courseCode}/{subject}/{university}

  • @PathVariable: courseCode
  • @PathVariable: subject
  • @PathVariable: universityName

R8: Book a Session

To book a single room and notify the tutor, we use the following endpoint,
Post Mapping: http://localhost:8080/session/{sessionId}/{tutorName}/{studentName}/{startTime}/{endTime}/{date}/{roomNr}/{courseCode}

  • @PathVariable : sessionId
  • @PathVariable : tutorName
  • @PathVariable : studentName
  • @PathVariable : roomNr
  • @PathVariable : date
  • @PathVariable : startTime
  • @PathVariable : endTime
  • @PathVariable : courseCode

R9: Check Room Availability

To check room availability we use the following endpoint,
Get Mapping: http://localhost:8080/room/checkAvail/{roomNr}/{testDate}/{testStartTime}/{testEndTime}

  • @PathVariable : roomNr
  • @PathVariable : testDate
  • @PathVariable : testStartTime
  • @PathVariable : testEndTime

R10: Notify Tutor

Once a session gets created the tutor is automatically notified.

R11: Assign Room

To assign a room to a session, we use the following endpoint,
Post Mapping: http://localhost:8080/session/assign/{sessionId}/

  • PathVariable: sessionId

R12: Cancel Session

To cancel a session, we use the following endpoint,
Post Mapping: http://localhost:8080/session/cancel/{sessionId}

  • @PathVariable: sessionId

R13: Tutor Reviews

To create a tutor review, we use the following endpoint,
Post Mapping: http://localhost:8080/studentReview/{id}/{review}/{revieweeId}/{rating}/{reviewerId}

  • @PathVariable : id
  • @PathVariable : review
  • @PathVariable : rating
  • @PathVariable : revieweeId
  • @PathVariable : reviewerId

R14: Student Reviews

To create a student review, we use the following endpoint,
Post Mapping: http://localhost:8080//studentReview/{id}/{review}/{reviewerId}/{revieweeId}

  • @PathVariable : id
  • @PathVariable : review
  • @PathVariable : reviewerId
  • @PathVariable : revieweeId

R15: Manage Session

To view the logged-in student's previous and upcoming sessions, use the following endpoint,
Get Mapping: http://localhost:8080/sessions