代写 Client-Server API Implementation 程序

- 首页 >> Algorithm 算法
Coursework Assignment: Programming 3

Table of Contents
Use Case Scenario and Problem Definition .......................................................... 1
Requirements Specification............................................................................. 2
Minimum Required Features ..................................................................................................... 2
Feature 1: Register and Authenticate........................................................................................ 2
Feature 2: Post Touristic Location Information .......................................................................... 3
Feature 3: Get information about Tourist Locations................................................................... 4
Feature 4: Add Coordinates to Tourist Locations....................................................................... 6
6. Advanced Feature..................................................................................................................... 7
Feature 5: Attach Weather Information...................................................................................... 7
Assessment Criteria ...................................................................................... 8
Grading: Coursework Assignment .......................................................... 8
Assignment Deliverables and Feedback – Important Dates ....................................... 8
Access to Support Material and Additional Information ........................................... 9
Note: Using AI ............................................................................................. 9
Client-Server API Implementation for a Tourist Locations
Information System
Use Case Scenario and Problem Definition
Use Case Scenario: Travellers from around the world want to share and access information about
tourist attractions in Oulu, Finland via a Tourist Locations Information system. This system should
be implemented on a server, allowing the users to access it. Only the registered users should be
able to post touristic location information in the system.
Problem Definition: You, as a developer, should implement a server API based on the use case
scenario. The server API should be implemented for delivering the expected functionalities as per
the requirements defined below.
2
Requirements Specification
Minimum requirements
ID Description
REQ1 HTTP Headers must include the Content
Length in bytes and Content Type using
standard HTTP headers
REQ2 All content in the HTTP requests/responses
must be JSON (except for the server error
messages, which may be text)
REQ3 HTTP header Content-Type must be
“application/json”
REQ4 All text in the HTTP body must use UTF-8
encoding
REQ5 All dates and times in JSON content MUST
follow the ISO 8601 UTC format with
milliseconds, e.g., 2020-12-21T07:57:47.131Z.
REQ6 All user data and corresponding tourist
location information must be stored in a
database.
3
Minimum Required Features
Feature 1: Register and Authenticate
URL: https://server.url/registration
Request Type: POST
Authorization: Not required
Response code for successful operation: 200
Response code for failed operation: 400 - 499
Header information that must be included at a minimum:
- Content-Length: size of the content
- Content-Type: application/json
Example data format for registering a user:
{
"userName": "username",
"password": "password",
"email": "user.email@for-contacting.com",
"userNickname": "Sam"
}
Note: Server MUST NOT accept other than registration requests from unauthorized clients.
For other than registration requests, users MUST be authenticated using Basic HTTP
authentication. Authentication MUST be done over HTTPS using the Authorization header, where
username:password string MUST be UTF-8.
4
Feature 2: Post Touristic Location Information
URL: https://server.url/info
Method: POST
Authorization: Only registered users can perform this operation
Response code for successful operation: 200
Response code for failed operation: 400 - 499
Header information that must be included at a minimum:
- Content-Length: size of the content
- Content-Type: application/json
Example data format for posting a touristic location information:
{
"locationName": "Oulun Tuomiokirkko",
"locationDescription": "The church of Oulu",
"locationCity": "Oulu",
"locationCountry": "Finland",
"locationStreetAddress": "Kirkkokatu 3 A",
"originalPoster": "Pekka",
"originalPostingTime": "2020-12-21T07:57:47.123Z"
}
where:
- locationName is the name of the location and can be chosen by the user
- locationDescription: is a free description that the user can provide of the tourist location
- locationCity: is the name of the city where the tourist location is
- locationStreetAddress: is the local address for the tourist location
- originalPoster: is the name of the person who sent the tourist location information
- originalPostingTime: is when the user sent the tourist location information, represented in UTC
5
Feature 3: Get information about Tourist Locations
URL: https://server.url/info
Method: GET
Authorization: Only registered users can perform this operation
Response code for successful operation: 200
Response code for failed operation: 400 - 499
Header information that must be included at a minimum:
- Content-Length: size of the content
- Content-Type: application/json
Note: Server may respond with 204 or empty body if there are no available coordinates.
Example response data format for sending back data to the client:
[
{
"locationName": "Oulun Tuomiokirkko",
"locationDescription": "The church of Oulu",
"locationCity": "Oulu",
"locationCountry": "Finland",
"locationStreetAddress": "Kirkkokatu 3 A",
"originalPoster": "Pekka",
"originalPostingTime": "2020-12-21T07:57:47.123Z"
},
{
"locationName": "Nallikari Beach",
"locationDescription": "The most popular beach in Oulu",
"locationCity": "Oulu",
"locationCountry": "Finland",
"locationStreetAddress": "Nallikarinranta, 90500 Oulu",
"originalPoster": "Anna",
"originalPostingTime": "2024-12-21T07:57:47.123Z"
}
]
6
Feature 4: Add Coordinates to Tourist Locations
URL: https://server.url/info
Method: POST
Authorization: Only registered users can perform this operation
Response code for successful operation: 200
Response code for failed operation: 400 - 499
Header information that must be included at a minimum:
- Content-Length: size of the content
- Content-Type: application/json
Example data format for posting a touristic location information:
{
"locationName": "Oulun Tuomiokirkko",
"locationDescription": "The church of Oulu",
"locationCity": "Oulu",
"locationCountry": "Finland",
"locationStreetAddress": "Kirkkokatu 3 A",
"originalPoster": "Pekka",
"originalPostingTime": "2020-12-21T07:57:47.123Z",
"latitude": "65.0580507136066",
"longitude": "25.469414591526057"
}
Note: Coordinates are not mandatory. If no coordinates exist for a tourist location, no
coordinates are provided in the response message sent to the client.
7
6. Advanced Feature
Feature 5: Attach Weather Information
URL: https://server.url/info
Method: POST
Authorization: Only registered users can perform this operation
Response code for successful operation: 200
Response code for failed operation: 400 - 499
Header information that must be included at a minimum:
- Content-Length: size of the content
- Content-Type: application/json
Example data format for posting a touristic location information:
{
"locationName": "Oulun Tuomiokirkko",
"locationDescription": "The church of Oulu",
"locationCity": "Oulu",
"locationCountry": "Finland",
"locationStreetAddress": "Kirkkokatu 3 A",
"originalPoster": "Pekka",
"originalPostingTime": "2020-12-21T07:57:47.123Z",
"latitude": "65.0580507136066",
"longitude": "25.469414591526057",
"weather": ""
}
where:
- weather can be an integer, double, or “1C” representation of temperature data given from the
weather service
Note:
- The user attaching weather data is optional.
- Weather information is based on the coordinates corresponding to the location.
- Weather information is obtained from a custom-built service.
- The messages with weather information must contain temperature of the location in the request
- The weather service will be provided separately; the server must send the coordinates to the
weather service that will provide the weather information related to the coordinates.
8
The attached jar (in Moodle) contains the package you need for feature 5. You can initiate it off
with the following command:
java -jar .\weatherserver-http.jar 4001,
where 4001 is the port number.
The server listens to http, so no keystores are needed.
Send a message with curl to http://localhost:portnumber/weather and you receive short reply
instructing what you need to send to the weather server in order to get weather information.
For example:
curl http://localhost:4001/weather -k -H "Content-Type:application/xml" -v
NOTE: Weather server only listens to POST commands and specific XML messages:

28.23333
10.23344

Assessment Criteria
Complete the coursework assignment on or before the given deadline (Deadlines are found in
Moodle. Submissions must be made to the GitLab repository. These GitLab submissions must at
least pass the automated tests to receive the minimum points allocated for the assignment.
Late submissions or late changes to Coursework Assignments will result in a penalty of 5 points for
each day past the deadline.
Grading: Coursework Assignment
Activity Individual Total Weight
Minimum API implementation:
Features 1-4
45 pts 45%
Gitlab documentation 5 pts 5%
Advanced API Feature: Feature 5 5 pts
5%
Database programming 20 pts 20%
Total: Coursework Assignment 75 pts 75%
9
Assignment Deliverables and Feedback – Important Dates
Each student will have a GitLab repository created for submitting their Exercises and Coursework.
The Gitlab submissions must at least pass the automated tests to receive the minimum grade
for the assignment. Please find further instructions in Moodle.
Assignment Deadline
Coursework Submission 21.11.2025
Access to Support Material and Additional Information
The teaching, learning, and support material is provided electronically via the NJIT Moodle system
(https://moodle.njit.edu.cn/). The students who have enrolled will have access to a GitLab
repository at https://njit-ci.oulu.fi. They must set up their authenticated access according to the
instructions given in the GitLab user manual provided in Moodle. Please check and inform the
responsible teacher or NJIT teacher if the Gitlab Repository link is broken or non-accessible,
preferably during the contact teaching hours and at least a week before the first Gitlab submission
deadline.
For inquiries, please email the responsible teacher at vishaka.basnayake@oulu.fi from Monday to
Friday, 8 AM to 5 PM.
Note: Using AI
All the assignment deliverables need to be submitted in English, if there are ideas or content
which needs to be expressed in Chinese (e.g. demonstrating language translation capabilities of
the developed applications etc. stuff, if such issues apply), also those contents need to be
translated into English to the extent that makes judgment of your deliverables possible in English.
For the same reason, we STRONGLY DISCOURAGE the use of automatic language translators and
other such tools at first when you produce your text and content in English. Try to formulate your
text first in English on your own, AFTER WHICH you can expose your text to language check, seek
the right concepts and expressions, etc., if the appropriate tools are available to you. We are
more interested in what has been learned through human thinking and analytical processes.
The assignment documents may be checked with plagiarism detection and artificial intelligence
detection tools, in case the teachers suspect unauthorized use of such means, and individual
assignment deliverables need to be originally produced by each student. The documentation needs
to report if and how any language translation or artificial intelligence-related tools have been
used in the report. Improper use of such tools, as well as detected plagiarism, leads to disciplinary
processes according to the rules and practices of the NJIT-Oulu school.
站长地图