From 7e2dfdf784103b14e2cf94e69b27b6e89af49b4f Mon Sep 17 00:00:00 2001 From: Sherwin Price Date: Thu, 8 Jan 2026 16:08:52 -0500 Subject: [PATCH] updates --- .vscode/launch.json | 20 +++++++- Api/.gitignore | 8 ---- Api/bin/main/edu/inventorym/Api.class | Bin 6281 -> 0 bytes Api/build.gradle | 36 --------------- Api/src/resources/db/customers.json | 23 ---------- Api/src/resources/db/inventory.json | 2 - Api/src/resources/db/transactions.json | 31 ------------- Ui/build.gradle | 7 ++- .../java/edu/inventorym/ApiController.java | 43 +++++++++++------- .../{Application.java => BackendService.java} | 15 ++++-- UiView/build.gradle | 9 ++-- .../java/edu/inventorym/ApplicationView.java | 1 + settings.gradle | 1 - 13 files changed, 68 insertions(+), 128 deletions(-) delete mode 100644 Api/.gitignore delete mode 100644 Api/bin/main/edu/inventorym/Api.class delete mode 100644 Api/build.gradle delete mode 100644 Api/src/resources/db/customers.json delete mode 100644 Api/src/resources/db/inventory.json delete mode 100644 Api/src/resources/db/transactions.json rename Api/src/main/java/edu/inventorym/Api.java => Ui/src/main/java/edu/inventorym/ApiController.java (86%) rename Ui/src/main/java/edu/inventorym/{Application.java => BackendService.java} (68%) diff --git a/.vscode/launch.json b/.vscode/launch.json index d85a026..d3f95d1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,23 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "type": "java", + "name": "ApiController", + "request": "launch", + "mainClass": "edu.inventorym.ApiController", + "projectName": "Ui" + }, + { + "type": "java", + "name": "Application", + "request": "launch", + "mainClass": "edu.inventorym.Application", + "projectName": "Ui", + "noDebug": false, + "__progressId": "ac782dee-a961-4892-9b94-9090bfdfcbda", + "__origin": "internal" + }, { "type": "java", "name": "ApplicationView", @@ -11,7 +28,6 @@ "mainClass": "edu.inventorym.ApplicationView", "projectName": "UiView", "vmArgs": " --module-path /home/sherwinp/workspace/javafx-sdk/lib --add-modules ALL-MODULE-PATH --enable-native-access=javafx.web,javafx.controls,javafx.media,javafx.graphics -Dcom.sun.management.jmxremote=false -Djava.awt.headless=true -XX:+DisableAttachMechanism" - }, - + } ] } \ No newline at end of file diff --git a/Api/.gitignore b/Api/.gitignore deleted file mode 100644 index 68f70f3..0000000 --- a/Api/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Ignore Gradle project-specific cache directory -.gradle - -# Ignore Gradle build output directory -build - -# Ignore bin -bin diff --git a/Api/bin/main/edu/inventorym/Api.class b/Api/bin/main/edu/inventorym/Api.class deleted file mode 100644 index f0fe5baa4d57532e92c6e19b4e96dd477a47b167..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6281 zcmX^0Z`VEs1_oC~KXwKtMh2nOlv4f7yt351lKi5|Tz$uaOm+qqMh1bb#Ii*FoW#6z zegCAa)Z`LI2A15!%sfU0F^y;+gk*3@QD$DcwPqM21B-KhN-8%4BLgQ70~Z4~BLjbO zVopwKk!M~>YEfEZaw;POvj#{ZzfWdfs$XetQfg61Vp2{jBZH7nesW??SYlBohz}KH zNi0e)W@He?VjUNQAcHVFgAgNwDw_Lq^HWlD^gUr7@=eT3OiwN1VGv;uWn|z^Pc8Ax zD=taQ135-hL(_*S-PR!M#CaGbK%QdB$xlq-WDsPK;$e_xkYQxt^z;jJ^$YP2iezL^ zAz+|SW^su%7lRyw0y~2|BZCrt>p`k{7!(Iv0a7gBlNmI>^OrHko;uC3c{g(d1#!V$cRhWp*kfgPjI;_d*S^#t}X+X;84} z@-XNz=rb}fC#Iw@GHBp15FQ@^nW@RC)|z4L42FyhQdoTuP?VWh!o^^~paycW3CP8! zj0{#dOa`mQ)d#7#Vns4Gnb7 z%*}L7EKE!|7$O)M__GsBQXO(ji&IN;^^)^*xfuKzqClA>nvua<1G7*gPed~e6iBh4 zd=baUpoAkzVIHv7jN)KOU}RwS%FN|pNMdAQb1%(J%BkdFNMU5)F)}bl@_+4O9ntYC_xquA!jHthpF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lfZ z7J||rC`28h7Un^HsG}v!sJD&L0Aisb#6lx2VMgO^j3!#bjHcTd%^>z#BH1ekE-x1` zurn-X;A2?AAj+_mL55)&gEGT%1}%maNOtQmN- getInventory() { /* Inventory pieces */ InventoryManager.getInstance().load(); if (InventoryManager.getInstance().INVENTORY.isEmpty()) { @@ -45,6 +46,16 @@ public interface Api { InventoryManager.getInstance().add(make(new Sculpture())); InventoryManager.getInstance().add(make(new Sculpture())); } + return new ResponseEntity<>("Resource loaded!", HttpStatus.OK); + } + + static void callerInterface() { + // @Comment + /* + * 1. Add new art object to the inventory. Your manager must check that the art + * is not already in the inventory before adding + */ + /* Customers */ CustomerManager.getInstance().load(); if (CustomerManager.getInstance().CUSTOMERS.isEmpty()) { @@ -75,7 +86,7 @@ public interface Api { System.out.println("\n"); if (imgr.INVENTORY.isEmpty()) { - System.out.println(String.format("%s: No Inventoried Art Piecies Available !!!. ", Api.class)); + System.out.println(String.format("%s: No Inventoried Art Piecies Available !!!. ", ApiController.class)); return; } @@ -98,7 +109,7 @@ public interface Api { */ tmgr.compute(tran); tmgr.complete(tran); - //tmgr.remove(tran); + // tmgr.remove(tran); /* * 7. Format and return transaction data in print format */ diff --git a/Ui/src/main/java/edu/inventorym/Application.java b/Ui/src/main/java/edu/inventorym/BackendService.java similarity index 68% rename from Ui/src/main/java/edu/inventorym/Application.java rename to Ui/src/main/java/edu/inventorym/BackendService.java index 9a4ad9f..cda60cb 100644 --- a/Ui/src/main/java/edu/inventorym/Application.java +++ b/Ui/src/main/java/edu/inventorym/BackendService.java @@ -4,6 +4,8 @@ */ package edu.inventorym; +import java.util.concurrent.CompletableFuture; + import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; @@ -17,18 +19,21 @@ import io.swagger.v3.oas.annotations.info.Info; @EnableWebFlux @SpringBootApplication @OpenAPIDefinition(info = @Info(title = "Model API", version = "3.0.0", description = "Documentation Model API v1.0")) -public class Application { +public class BackendService { - public static void main(String[] args) { - new SpringApplicationBuilder() + public static final void BackendServiceStart(String[] args){ + CompletableFuture.runAsync(() -> { + // Long-running background operation + new SpringApplicationBuilder() .profiles("dev") .web(WebApplicationType.REACTIVE) - .sources(Application.class, Controller.class) + .sources(BackendService.class, Controller.class, ApiController.class) .run(args); + }); } @Bean - public NettyReactiveWebServerFactory nettyServerFactory() { + public static final NettyReactiveWebServerFactory nettyServerFactory() { NettyReactiveWebServerFactory factory = new NettyReactiveWebServerFactory(); return factory; } diff --git a/UiView/build.gradle b/UiView/build.gradle index de5360f..70beae3 100644 --- a/UiView/build.gradle +++ b/UiView/build.gradle @@ -55,18 +55,21 @@ javafx { dependencies { + implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.17' + implementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.17' + //https://mvnrepository.com/artifact/com.google.code.gson/gson implementation 'com.google.code.gson:gson:2.13.2' + implementation 'org.openjfx:javafx-base:25.0.1' implementation 'org.openjfx:javafx-fxml:25.0.1' implementation 'org.openjfx:javafx-controls:25.0.1' implementation 'org.openjfx:javafx-graphics:25.0.1' implementation 'org.openjfx:javafx-web:25.0.1' - implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.17' - implementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.17' + implementation project(':Model') - implementation project(':Api') + implementation project(':Ui') } diff --git a/UiView/src/main/java/edu/inventorym/ApplicationView.java b/UiView/src/main/java/edu/inventorym/ApplicationView.java index 74c34d2..1facad9 100644 --- a/UiView/src/main/java/edu/inventorym/ApplicationView.java +++ b/UiView/src/main/java/edu/inventorym/ApplicationView.java @@ -43,6 +43,7 @@ public class ApplicationView extends Application { } public static void main(String[] args) { + BackendService.BackendServiceStart(args); launch(args); } } \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 1ff5f20..9061f1c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,6 +6,5 @@ plugins { rootProject.name = 'inventorym' include('Model') -include('Api') include('Ui') include('UiView')