讲解:COMP 74、TripAPI_Starter、c++,Java/PythonHaskell|Python

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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Awesome Ruby Toolbox Awesome A collection of awesome Ruby...
    debbbbie阅读 8,027评论 0 3
  • By clicking to agree to this Schedule 2, which is hereby ...
    qaz0622阅读 5,415评论 0 2
  • 我觉得现在的自己面目可憎,这让我感到惊恐。回头看我到底是怎么变成现在这副德行的,如此丑陋的嘴脸,粗俗的言行...
    独孤羊小七阅读 4,408评论 0 0
  • 在软件工程中,单例模式是一种将类限制为只能实例化一个对象的设计模式。当只需要一个对象来协调整个系统的操作时,这非常...
    spring_m阅读 1,441评论 0 0
  • 记得常回家看看 坐在门口手里忙活着但心里空空落落的老太太 在等着你的归来 她不喜欢安静到有些孤独的氛围 家里从别人...
    晴好很仙儿阅读 1,598评论 0 0

友情链接更多精彩内容