讲解: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

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,470评论 6 501
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,393评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,577评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,176评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,189评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,155评论 1 299
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,041评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,903评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,319评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,539评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,703评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,417评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,013评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,664评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,818评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,711评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,601评论 2 353

推荐阅读更多精彩内容

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