team-5-tp / travel-planner

Google Map API based travel utility
0 stars 1 forks source link

Plan RESTfull API #3

Closed risetarnished closed 5 years ago

risetarnished commented 5 years ago

A Java class to represent a plan Add/Delete/Update/Select RESTful API

risetarnished commented 5 years ago

The Plan class and database table are functioning now without integration of the POI class.

risetarnished commented 5 years ago

Two plans tested (plan_id=1&user_id=1 and plan_id=2&user_id=1)

  1. GET localhost:8080/TravelPlanner/userplan?plan_id=1&user_id=1 will return a JSON object containing the plan info
  2. POST localhost:8080/TravelPlanner/userplan with given parameters plan_id, planname, and user_id (the user needs to be in the user table) returns an HTTP response with either successful or failed message indicating whether the plan has been saved or not.