Giter Site home page Giter Site logo

order-rest-backend's Introduction

Order Management REST API CI Status

Demonstrates a simple RESTful web service using Spring MVC and Java. This web service provides an in-memory order management service, with the capability to get a single order, get all orders, create an order, delete an order, and update an order. After exploring this project, the reader will understand the three common layers of a RESTful web service (namely domain, data source, and presentation), the common design decisions used when creating a web service, and the functionality provided by the Spring framework for creating a web service (as well as supplemental functionality, such as creating HATEOAS links). In particular, the reader will learn

  • How to create a domain model
  • How to store domain objects in a persistence layer
  • How to wrap domain objects within resource objects
  • How to add HATEOAS links to a resource
  • How to serve up resources to a client over HTTP
  • How to provide RESTful Create, Read, Update, and Delete (CRUD) operations to change domain objects
  • How to create unit, integration, and acceptance tests that exercise a REST API

Starting the Order Management System

To start this web service, install Maven and execute the following command

mvn spring-boot:run

Once the web service is started, it can be reached at

http://localhost:8080/order

REST Endpoints

The following REST endpoints are available upon deployment of the order management system:

HTTP Verb URL Description Status Codes
GET http://localhost:8080/order Obtains a list of all existing orders
  • 200 OK
GET http://localhost:8080/order/{id} Obtains the order corresponding to the supplied order ID
  • 200 OK if order exists
  • 404 Not Found if order does not exist
POST http://localhost:8080/order Creates a new order based on the payload contained in the request body
  • 201 Created if order successfully created
PUT http://localhost:8080/order/{id} Updated an existing order with the data contained in the request body
  • 200 OK if order succesfully updated
  • 404 Not Found if order does not exist
DELETE http://localhost:8080/order/{id} Deletes an existing order that corresponds to the supplied order ID
  • 203 No Content if order succesfully deleted
  • 404 Not Found if order does not exist

order-rest-backend's People

Contributors

albanoj2 avatar

Watchers

James Cloos avatar Malaka Ekanayake 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.