adjurk / food-deli

Example food delivery REST API for MPR classes @ PJAIT 2021

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Food Deli REST API

Java CI with Maven

Simple Java REST API for MPR classes @ PJAIT 2021.

Running

Before running, place bing.api.key generated from https://www.bingmapsportal.com/ inside src/resources/application.properties by replacing BING_API_KEY.

With Maven

Prerequisites:

  • JDK 1.8
  • Maven
mvn package
java -jar food-deli-0.0.1-SNAPSHOT.jar

With Docker

Prerequisites:

  • Docker
docker image build -t food-deli:0.0.1 .
docker run -p 8080:8080 food-deli:0.0.1

Example endpoints

Run the app first and use Postman to reach these endpoints. You can also import Postman collection file food-deli.postman_collection.json at repo root.

POST /customer

{
    "firstName": "Adam",
    "lastName": "Jurkiewicz",
    "address": "Subisława, Gdańsk"
}

POST /restaurant

{
    "name": "First Restaurant",
    "address": "Podwale Staromiejskie 51 Gdańsk",
    "open": true,
    "foods": [
        {
            "name": "French Fries",
            "cost": 12
        },
        {
            "name": "Vegan Bowl",
            "cost": 20
        }
    ],
    "maxDistance": 12,
    "deliveryCost": 6.0
}

POST /food-order

{
  "orderItems": [
    {
      "id": 1,
      "name": "French Fries",
      "cost": 12.0
    }
  ],
  "restaurant": {
    "id": 1,
    "name": "First Restaurant",
    "address": "Podwale Staromiejskie 51 Gdańsk",
    "open": true,
    "maxDistance": 12.0,
    "deliveryCost": 6.0
  },
  "customer": {
    "id": 1,
    "firstName": "Adam",
    "lastName": "Jurkiewicz",
    "address": "Subisława, Gdańsk"
  }
}

About

Example food delivery REST API for MPR classes @ PJAIT 2021


Languages

Language:Java 99.5%Language:Dockerfile 0.5%