COMP 74 Assignment 1Milestone 1Setup1.Make a copy of the Slim PHP TripAPI_Starter project located in the COMP 74/Assign1 academic share folder. 2.Open the project with NetBeans. 3.Right click the TripAPI_Starter project node and select Composer and then Install (no dev). This will install the Slim and Illuminate package dependencies. (If this step does not work, you probably need to set up Composer on your own computer. Follow the instructions at https://getcomposer.org/ ). 4.Review the code in index.php (API endpoints), and in Person.php and Trip.php (Eloquent models). The project currently defines some sample code for providing API endpoints (“/persons”, “/trips”, etc.) The “/trips” endpoint also includes some initial paging code. The models provide some sample code for retrieving data from the travel database. Step 1The sample code for this endpoint currently parses all of the URI components, and obtains the page number from the ‘page’ parameter. (If no ‘page’ parameter was sent with the request, the page number is assigned null.) The code also defines a ‘link to self’ URI (i.e. rebuilds the original URI from the parsed components.)Based on the sample code, complete the pagination code for the “/trips” endpoint by defining links to the first, last, next, and previous pages. For example if the trip table has 15 pages and page 4 is requested, the following links should be defined: first = http://localhost:8000/trips?page=1 last = http://localhost:8000/trips?page=15 prev = http://localhost:8000/trips?page=3 next = http://localhost:8000/trips?page=5Modify the sample code so that it returns these values in the ‘links’ field of the result.Add code to detect ‘out of range’ pages. (Note: TCOMP 74作业代做、代写TripAPI_Starter作业、c++,Java/Python程序设计作业代做 帮做Hahe Trip model class includes a method to that returns the page count.) Add code to include the item count in the result. The item count will be the same as the page count (i.e. 5) for all pages except the last one, in which case it will be in the range 1-4.Test your code in the Chrome browser (or with Postman) to make sure that the correct data and metadata (i.e. links and page count) are returned.Hand in At the end of the Week 6 Lab (Feb 12th), zip your entire project for this milestone to a zip file named YourLastName.zip, and copy it to the COMP 74 drop box folder. Milesone 2Step 21.Make a copy of the A1 Client Starter project (from Academic share or BlackBoard). This project contains code that makes a basic ajax request to the “/trips” endpoint in the TripAPI. 2.Open and run the TripAPI project. 3.Open and run the A1 Client Starter project. Test the client application by clicking the GET button. A list of five trips should be displayed.4.Based on the code in the A1 Client Starter create a test client for the TripAPI that you wrote for Milestone 1. Your client should include an interface that:a.includes a table which displays the trips returned from the API,b.uses the links (returned in the metadata) to allow the user to navigate backwards, forwards, to the start, and to the end of the trip data,c.allows the user to request a specific page of trip data,d.informs the user when a bad request is has been made (e.g. invalid page number). Note: this may require additional code in your TripAPI.Hand inAt the end of the Week 7 Lab (Feb 21th), zip your entire project for this milestone to a zip file named YourLastName.zip, and copy it to the COMP 74 drop box folder.转自:http://ass.3daixie.com/2019022234825234.html
讲解:COMP 74、TripAPI_Starter、c++,Java/PythonHaskell|Python
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- Awesome Ruby Toolbox Awesome A collection of awesome Ruby...
- By clicking to agree to this Schedule 2, which is hereby ...