added zwg support

This commit is contained in:
Prince
2026-06-17 14:43:56 +02:00
parent 0eda74414e
commit 6ccded7fce
2 changed files with 8 additions and 6 deletions

View File

@@ -34,9 +34,9 @@ public class ProviderController {
return ResponseEntity.ok(providerService.getProviderProducts(id.toString()));
}
@GetMapping("/{id}/products/{productId}")
public ResponseEntity getProducts(@PathVariable UUID id, @PathVariable UUID productId) {
return ResponseEntity.ok(providerService.getProviderProduct(id, productId));
@GetMapping("/{id}/products/{productName}")
public ResponseEntity getProducts(@PathVariable UUID id, @PathVariable String productName) {
return ResponseEntity.ok(providerService.getProviderProduct(id, productName));
}
@GetMapping("/client/{clientId}")

View File

@@ -41,11 +41,13 @@ public class ProviderService {
@Value("${sbz.aggregator.url}")
private String aggregatorUrl;
public SBZProductDto getProviderProduct(UUID providerId, UUID productId) {
return getProviderProducts(providerId.toString()).stream()
.filter(product -> product.getUid().equals(productId))
public SBZProductDto getProviderProduct(UUID providerId, String productName) {
List<SBZProductDto> products = getProviderProducts(providerId.toString());
SBZProductDto productResult = products.stream()
.filter(product -> product.getName().equals(productName))
.findFirst()
.orElse(null);
return productResult;
}
@Deprecated