Coder Social home page Coder Social logo

cinemaroomrestservice's Introduction

CinemaRoomRESTService

This project can show the available seats, sell and refund tickets, and display the statistics of the venue. I have used Spring boot and write the REST service.

Examples

Example 1: a GET /seats request

Response body:

{
   "total_rows":9,
   "total_columns":9,
   "available_seats":[
      {
         "row":1,
         "column":1,
         "price":10
      },
      {
         "row":1,
         "column":2,
         "price":10
      },
      {
         "row":1,
         "column":3,
         "price":10
      },

      ........

      {
         "row":9,
         "column":8,
         "price":8
      },
      {
         "row":9,
         "column":9,
         "price":8
      }
   ]
}


---------------------------------------------------------------------


Example 2: a correct POST /purchase request

Request body:

{
    "row": 3,
    "column": 4
}

Response body:

{
    "token": "e739267a-7031-4eed-a49c-65d8ac11f556",
    "ticket": {
        "row": 3,
        "column": 4,
        "price": 10
    }
}


-----------------------------------------------------------------------------------


Example 3: POST /return with the correct token

Request body:

{
    "token": "e739267a-7031-4eed-a49c-65d8ac11f556"
}

Response body:

{
    "returned_ticket": {
        "row": 1,
        "column": 2,
        "price": 10
    }
}


----------------------------------------------------------------------------------


Example 4: POST /return with an expired token

Request body:

{
    "token": "e739267a-7031-4eed-a49c-65d8ac11f556"
}

Response body:

{
    "error": "Wrong token!"
}


----------------------------------------------------------------------------------


Example 5: a POST /stats request with no parameters

Response body:

{
    "error": "The password is wrong!"
}


----------------------------------------------------------------------------------


Example 6: a POST /stats request with the correct password

Response body:

{
    "current_income": 30,
    "number_of_available_seats": 78,
    "number_of_purchased_tickets": 3
}

cinemaroomrestservice's People

Contributors

milton-kabir avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.