Skip to content

rmwhitman/Cinema-Room-REST-Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cinema-Room-REST-Service

HyperSkill.org project using REST services in Java

In this project I learned about REST services including GetMapping and PostMapping in order to send and receive information to a webpage.

What this program does:

  1. Display all seats - By accessing the "/seats" endpoint the program will send raw JSON information about a theater room including: total rows, total seats per row, and an arraylist of each seat with its row and column and the price of the seat.

  2. Purchase a seat - By accessing the "/purchase" endpoint with JSON information that includes the row and column of the requested seat the program will verify that the seat is valid and available for purchase and if it is then it will mark the seat as unavailable. The program will then send a JSON response to the webpage that includes a ticket(token) number generated by a random UUID as well the seat information including: row, column and price.

  3. Return a seat - By accessing the "/return" endpoint with the ticket(token) number that the user wishes to refund the program will respond with JSON information that states "returned_ticket" as well as the seat information including" row, column and price. The program will then mark this seat as available in the theater room which can now be purchased again.

  4. Access theater stats - By accessing the "/stats" endpoint with the correct parameters of key: password and value: super_secret the program will respond with JSON information including: "current_income" which shows the total cost of sold tickets for the theater, "number_of_purchased_tickets" which shows how many seats have been sold in the theater, and "number_of_available_seats" which shows how many seats are available for purchase.

About

HyperSkill.org project using REST services in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages