Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the following endpoints in java , a sample endpoint is provided for guidance: What is an endpoint? When an API interacts with another system,

Implement the following endpoints in java, a sample endpoint is provided for guidance: What is an endpoint? When an API interacts with another system, the touchpoints of this communication are considered endpoints. For APIs, an endpoint can include a URL of a server or service. Each endpoint is the location from which APIs can access the resources they need to carry out their function. Following table lists the API endpoints that you are expected to implement. Input column defines the fields that will be sent to the endpoint. Output defines the expected output of the endpoint. Examples regarding the way these are handled are present in the sample code provided image text in transcribed image text in transcribed image text in transcribed Sample endpoint implemented in java: (format for above endpoints is similar)

@RequestMapping(value = "/sample", method = RequestMethod.GET, produces = "application/json") public ResponseEntity helloWorld() { Map response = new HashMap(); try { response.put("message", "Hello World"); response.put("status", true); } catch (Exception ex) { response.put("status", false); } return ResponseEntity.status(HttpStatus.OK).body(response); }
Endpoint Input Output /stop/create POST StopName: String success: boolean - "true" if successful, "false" otherwise Create a Stop /stop/modify/rename POST Stopld: int NewName: String success: boolean "true" if successful, "false" otherwise Rename a Stop /stop/modify/delete POST Stopld: int success: boolean - "true" if successful, "false" otherwise Delete a Stop /stop/get_all GET stops: JSON Object Array - An array of Stops. Each object in the array is a Stop data from the table, and all of its data. Get All Stops /route/create POST RouteName: String stop_ids: int[ (int array) success: boolean "true" if successful,"false" otherwise Create a Route /route/modify/rename Routeld: int NewName: String success: boolean - "true" if successful,"false" otherwise POST Rename a Route /route/modify/add_stop POST Routeld: int Stopld: int success: boolean "true" if successful, "false" otherwise Add Stop to Route /route/modify/remove_stop Routeld: int Stopld: int success: boolean "true" if successful, "false" otherwise POST Routeld: int success: boolean "true" if successful, "false" otherwise Remove Stop From Route /route/delete POST Delete a Route /route/get POST Get Info of Route Routeld: int route: JSON Object - A JSON Object that contains all the information about a route. stops: JSON Object Array - List of stops that are in the route. - Each object in the array is a Stop data from the table, and all of its data. /route/get_all GET Get All Routes, Including their stop info routes: JSON Object Array . An array of Routes. Each object in the array is a Route data from the table." - stops: JSON Object Array - List of stops that are in the route. - Each object in the array is a Stop data from the table, and all of its data. TrainName: String success: boolean "true" if successful,"false" otherwise /train/create POST Create a Train /train/modify/rename POST Rename a Train /train/modify/delete POST Delete a Train Trainld: int NewName: String success: boolean "true" if successful, "false" otherwise Trainld: int success: boolean "true" if successful,"false" otherwise /statistics/schedule/stop Stopld: int POST schedules: JSON Object Array Contains all schedule data available in the database, and their contents. Get all schedules that pass from the given stop /statistics/schedules/time Time: String (unix timestamp) POST schedules: JSON Object Array Contains all schedule data available in the database, and their contents. Get all schedules that start at the given time /statistics/schedules/route Routeld: int POST schedules: JSON Object Array Contains all schedule data available in the database, and their contents. Stopld: int Time: String (unix timestamp) Get all schedules that uses the given route /statistics/schedules/time_stop POST Get all schedules that start at the given time and pass from the given stop /statistics/schedules/backup_count schedules: JSON Object Array Contains all schedule data available in the database, and their contents. K: int POST schedules: JSON Object Array Contains all schedule data available in the database, and their contents. Get all schedules that have at least K backup trains

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions