From 8fcdbe983de43c988bcd5e9402f16ceeb3f6852b Mon Sep 17 00:00:00 2001 From: Tom Lafford Date: Sun, 21 Nov 2021 13:37:36 +0000 Subject: [PATCH 01/11] CI status URL update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 19fbd91..1669634 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Java-Matching-Engine REST API -![Java CI with Maven](https://github.com/Laffini/Java-Matching-Engine/workflows/Java%20CI%20with%20Maven/badge.svg) +![Java CI with Maven](https://github.com/Laffini/Java-Matching-Engine-REST-API/workflows/Java%20CI%20with%20Maven/badge.svg) A matching engine written in Java. From 345c0c93934001c109a4496d9b4fee466255f780 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Nov 2021 09:47:34 +0000 Subject: [PATCH 02/11] Remove redundant scope --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index b4259b1..0828de6 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,6 @@ net.laffyco.java-matching-engine core 0.0.1-SNAPSHOT - compile org.springframework.boot From 36d3a11d7be7180c3b0928c158fcf964e4480888 Mon Sep 17 00:00:00 2001 From: Tom Lafford Date: Sat, 4 Dec 2021 16:48:52 +0000 Subject: [PATCH 03/11] Create build.yml --- .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a5d49fd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CI with Maven + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml From 43eb1a5324938731d2691f9a6a648b537f650c46 Mon Sep 17 00:00:00 2001 From: Tom Lafford Date: Sat, 4 Dec 2021 16:51:57 +0000 Subject: [PATCH 04/11] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5d49fd..c05b17d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,4 +23,4 @@ jobs: distribution: 'adopt' cache: maven - name: Build with Maven - run: mvn -B package --file pom.xml + run: mvn -s settings.xml -B package --file pom.xml From 1807a45ecfa8bbe989f9ef7f227d2b6fae550c16 Mon Sep 17 00:00:00 2001 From: Tom Lafford Date: Sat, 4 Dec 2021 17:08:31 +0000 Subject: [PATCH 05/11] Update build.yml --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c05b17d..1fb4a17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,5 +22,11 @@ jobs: java-version: '11' distribution: 'adopt' cache: maven + server-id: github + server-username: GITHUB_USER_REF + server-password: GITHUB_TOKEN_REF - name: Build with Maven + env: + GITHUB_USER_REF: ${{ secrets.GH_PACKAGE_REPO_USERNAME }} + GITHUB_TOKEN_REF: ${{ secrets.GH_PACKAGE_REPO_PASSWORD }} run: mvn -s settings.xml -B package --file pom.xml From d9fe63dbded7265f88e819073783988f689c4820 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Dec 2021 10:51:18 +0000 Subject: [PATCH 06/11] Update .classpath --- .classpath | 1 + 1 file changed, 1 insertion(+) diff --git a/.classpath b/.classpath index d575057..fc790a6 100644 --- a/.classpath +++ b/.classpath @@ -28,5 +28,6 @@ + From a4c4c29629f0830f0c3278dbb92ad150a7e0a88a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Dec 2021 10:55:54 +0000 Subject: [PATCH 07/11] Copy dependencies --- pom.xml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 0828de6..f5158c2 100644 --- a/pom.xml +++ b/pom.xml @@ -34,11 +34,11 @@ GitHub OWNER Apache Maven Packages https://maven.pkg.github.com/Laffini/Java-Matching-Engine-Core - true - - - true - + true + + + true + @@ -72,6 +72,24 @@ org.springframework.boot spring-boot-maven-plugin + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory} + false + true + + + + From 883a894ed19d3628c274ded1abba83004235b844 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Dec 2021 11:10:32 +0000 Subject: [PATCH 08/11] Remove spring plugin --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f5158c2..c34d74d 100644 --- a/pom.xml +++ b/pom.xml @@ -69,8 +69,8 @@ - org.springframework.boot - spring-boot-maven-plugin + org.apache.maven.plugins + maven-surefire-plugin org.apache.maven.plugins From ce0a97ec9393ae6ac6456b4cb34af1b5ce1a0166 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Dec 2021 11:11:46 +0000 Subject: [PATCH 09/11] Remove duplicated action --- .github/workflows/build.yml | 32 -------------------------------- .github/workflows/maven.yml | 12 +++++++----- 2 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 1fb4a17..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - cache: maven - server-id: github - server-username: GITHUB_USER_REF - server-password: GITHUB_TOKEN_REF - - name: Build with Maven - env: - GITHUB_USER_REF: ${{ secrets.GH_PACKAGE_REPO_USERNAME }} - GITHUB_TOKEN_REF: ${{ secrets.GH_PACKAGE_REPO_PASSWORD }} - run: mvn -s settings.xml -B package --file pom.xml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0e3dc4b..1fb4a17 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,4 +1,4 @@ -# This workflow will build a Java project with Maven +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven name: Java CI with Maven @@ -16,10 +16,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - name: Set up JDK 11 + uses: actions/setup-java@v2 with: - java-version: 1.8 + java-version: '11' + distribution: 'adopt' + cache: maven server-id: github server-username: GITHUB_USER_REF server-password: GITHUB_TOKEN_REF @@ -27,4 +29,4 @@ jobs: env: GITHUB_USER_REF: ${{ secrets.GH_PACKAGE_REPO_USERNAME }} GITHUB_TOKEN_REF: ${{ secrets.GH_PACKAGE_REPO_PASSWORD }} - run: mvn clean install -s settings.xml -B package --file pom.xml -X \ No newline at end of file + run: mvn -s settings.xml -B package --file pom.xml From 46581485e2188e398b044b8a066ff19b2ae797ec Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Dec 2021 14:05:10 +0000 Subject: [PATCH 10/11] Update to JDK 17 --- .classpath | 7 +------ .github/workflows/maven.yml | 4 ++-- pom.xml | 20 +------------------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/.classpath b/.classpath index fc790a6..6fd6b4f 100644 --- a/.classpath +++ b/.classpath @@ -18,16 +18,11 @@ - - - - - - + diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 1fb4a17..e855b3f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '11' + java-version: '17' distribution: 'adopt' cache: maven server-id: github diff --git a/pom.xml b/pom.xml index c34d74d..571f108 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ rest-api Rest API for the Java Matching Engine - 1.8 + 17 @@ -72,24 +72,6 @@ org.apache.maven.plugins maven-surefire-plugin - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - package - - copy-dependencies - - - ${project.build.directory} - false - true - - - - From 9e16ae1b83a6e89d21a94c7c924e1610b835d20f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2021 09:03:08 +0000 Subject: [PATCH 11/11] URL best practices --- README.md | 16 ++++++++-------- .../restapi/controllers/OrderController.java | 2 +- .../restapi/controllers/SpreadController.java | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1669634..41da75f 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,10 @@ User A creates a buy order of 2 items (e.g. 2 shares, 2 bitcoin, etc) with a pri ##### Request ``` -POST /order/ - ?side=BUY - &amount=2 - &price=5 +POST /api/v1/order/ + ?side=BUY + &amount=2 + &price=5 ``` ##### Response @@ -67,10 +67,10 @@ User B creates a sell order of 2 items with a price of 5. ##### Request ``` -POST /order/ - ?side=SELL - &amount=2 - &price=5 +POST api/v1//order/ + ?side=SELL + &amount=2 + &price=5 ``` ##### Response diff --git a/src/main/java/net/laffyco/javamatchingengine/restapi/controllers/OrderController.java b/src/main/java/net/laffyco/javamatchingengine/restapi/controllers/OrderController.java index 3d3b488..071ae08 100644 --- a/src/main/java/net/laffyco/javamatchingengine/restapi/controllers/OrderController.java +++ b/src/main/java/net/laffyco/javamatchingengine/restapi/controllers/OrderController.java @@ -25,7 +25,7 @@ * */ @RestController -@RequestMapping("/order") +@RequestMapping("/api/v1/order") public class OrderController { /** diff --git a/src/main/java/net/laffyco/javamatchingengine/restapi/controllers/SpreadController.java b/src/main/java/net/laffyco/javamatchingengine/restapi/controllers/SpreadController.java index 0ee5f3b..de6e598 100644 --- a/src/main/java/net/laffyco/javamatchingengine/restapi/controllers/SpreadController.java +++ b/src/main/java/net/laffyco/javamatchingengine/restapi/controllers/SpreadController.java @@ -16,7 +16,7 @@ * */ @RestController -@RequestMapping("/spread") +@RequestMapping("/api/v1/spread") public class SpreadController { /**