Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add factories #52

Merged
merged 4 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@
opens org.chainoptim.desktop.shared.common.uielements.performance to javafx.fxml, com.google.guice;
opens org.chainoptim.desktop.shared.common.uielements.info to javafx.fxml, com.google.guice;
opens org.chainoptim.desktop.shared.common.uielements.settings to javafx.fxml, com.google.guice;
opens org.chainoptim.desktop.shared.common.uielements to com.google.guice;

// - Enums
opens org.chainoptim.desktop.shared.enums to com.fasterxml.jackson.databind;

// - Table
opens org.chainoptim.desktop.shared.table to javafx.fxml, com.google.guice;
opens org.chainoptim.desktop.shared.table.util to com.google.guice;

// - Location
opens org.chainoptim.desktop.shared.features.location.model to com.fasterxml.jackson.databind;
Expand Down
20 changes: 15 additions & 5 deletions src/main/java/org/chainoptim/desktop/AppModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.chainoptim.desktop.features.scanalysis.supply.service.SupplierPerformanceService;
import org.chainoptim.desktop.features.scanalysis.supply.service.SupplierPerformanceServiceImpl;
import org.chainoptim.desktop.features.supplier.model.Supplier;
import org.chainoptim.desktop.features.supplier.model.SupplierOrder;
import org.chainoptim.desktop.features.supplier.service.*;
import org.chainoptim.desktop.features.warehouse.model.Warehouse;
import org.chainoptim.desktop.features.warehouse.service.WarehouseService;
Expand Down Expand Up @@ -137,6 +138,7 @@ protected void configure() {
bind(SupplierService.class).to(SupplierServiceImpl.class);
bind(SupplierWriteService.class).to(SupplierWriteServiceImpl.class);
bind(SupplierOrdersService.class).to(SupplierOrdersServiceImpl.class);
bind(SupplierOrdersWriteService.class).to(SupplierOrdersWriteServiceImpl.class);

// - Components
bind(ComponentService.class).to(ComponentServiceImpl.class);
Expand Down Expand Up @@ -168,15 +170,23 @@ protected void configure() {

// - Caching
bind(new TypeLiteral<CachingService<PaginatedResults<Product>>>() {})
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Product>>>() {});
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Product>>>() {})
.in(Singleton.class);
bind(new TypeLiteral<CachingService<PaginatedResults<Factory>>>() {})
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Factory>>>() {});
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Factory>>>() {})
.in(Singleton.class);
bind(new TypeLiteral<CachingService<PaginatedResults<Warehouse>>>() {})
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Warehouse>>>() {});
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Warehouse>>>() {})
.in(Singleton.class);
bind(new TypeLiteral<CachingService<PaginatedResults<Supplier>>>() {})
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Supplier>>>() {});
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Supplier>>>() {})
.in(Singleton.class);
bind(new TypeLiteral<CachingService<PaginatedResults<SupplierOrder>>>() {})
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<SupplierOrder>>>() {})
.in(Singleton.class);
bind(new TypeLiteral<CachingService<PaginatedResults<Client>>>() {})
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Client>>>() {});
.to(new TypeLiteral<CachingServiceImpl<PaginatedResults<Client>>>() {})
.in(Singleton.class);
bind(new TypeLiteral<CachingService<ResourceAllocationPlan>>() {})
.to(new TypeLiteral<CachingServiceImpl<ResourceAllocationPlan>>() {})
.in(Singleton.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public CompletableFuture<Optional<PaginatedResults<Client>>> getClientsByOrganiz
SearchParams searchParams
) {
String rootAddress = "http://localhost:8080/api/v1/";
String cacheKey = CacheKeyBuilder.buildAdvancedSearchKey("products", organizationId, searchParams);
String cacheKey = CacheKeyBuilder.buildAdvancedSearchKey("products", "organization", organizationId, searchParams);
String routeAddress = rootAddress + cacheKey;

String jwtToken = TokenManager.getToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public CompletableFuture<Optional<PaginatedResults<Factory>>> getFactoriesByOrga
SearchParams searchParams
) {
String rootAddress = "http://localhost:8080/api/v1/";
String cacheKey = CacheKeyBuilder.buildAdvancedSearchKey("factories", organizationId, searchParams);
String cacheKey = CacheKeyBuilder.buildAdvancedSearchKey("factories", "organization", organizationId, searchParams);
String routeAddress = rootAddress + cacheKey;

String jwtToken = TokenManager.getToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public CompletableFuture<Optional<PaginatedResults<Product>>> getProductsByOrgan
SearchParams searchParams
) {
String rootAddress = "http://localhost:8080/api/v1/";
String cacheKey = CacheKeyBuilder.buildAdvancedSearchKey("products", organizationId, searchParams);
String cacheKey = CacheKeyBuilder.buildAdvancedSearchKey("products", "organization", organizationId, searchParams);
String routeAddress = rootAddress + cacheKey;

String jwtToken = TokenManager.getToken();
Expand Down
Loading
Loading