more meta data in product api

This commit is contained in:
2026-01-08 06:08:06 -05:00
parent a0ab520d5a
commit 50992a03c4
4 changed files with 24 additions and 2 deletions

View File

@@ -46,6 +46,10 @@ public class SecurityConfig {
.requestMatchers("/actuator/health", "/actuator/info").permitAll()
.requestMatchers("/api/products/gunbuilder/**").permitAll()
// Short links (public redirect)
.requestMatchers(HttpMethod.GET, "/go/**").permitAll()
.requestMatchers(HttpMethod.HEAD, "/go/**").permitAll()
// Public builds feed + public build detail (1 path segment only)
.requestMatchers(HttpMethod.GET, "/api/v1/builds").permitAll()
.requestMatchers(HttpMethod.GET, "/api/v1/builds/*").permitAll()

View File

@@ -13,4 +13,12 @@ public class CatalogOptionDto {
public BigDecimal price;
public String buyUrl;
public Boolean inStock;
}
private String caliber;
public String getCaliber() {
return caliber;
}
public void setCaliber(String caliber) {
this.caliber = caliber;
}}

View File

@@ -64,6 +64,11 @@ public class ProductSummaryDto {
this.categoryKey = categoryKey;
}
private String caliber;
public String getCaliber() { return caliber; }
public void setCaliber(String caliber) { this.caliber = caliber; }
public BigDecimal getPrice() {
return price;
}
@@ -72,6 +77,11 @@ public class ProductSummaryDto {
this.price = price;
}
private Boolean inStock;
public Boolean getInStock() { return inStock; }
public void setInStock(Boolean inStock) { this.inStock = inStock; }
public String getBuyUrl() {
return buyUrl;
}

View File

@@ -16,7 +16,7 @@ public class ProductMapper {
dto.setBrand(product.getBrand() != null ? product.getBrand().getName() : null);
dto.setPlatform(product.getPlatform());
dto.setPartRole(product.getPartRole());
dto.setCaliber(product.getCaliber());
dto.setCategoryKey(product.getRawCategoryKey());
dto.setPrice(price);