add metadata-backed game scope resolver
This commit is contained in:
@@ -9,6 +9,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@EnableConfigurationProperties({
|
||||
BackofficeProperties.class,
|
||||
CatalogProperties.class,
|
||||
GameScopeProperties.class,
|
||||
MaskingProperties.class,
|
||||
McpProperties.class,
|
||||
ProductProperties.class,
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cloudhandson.vpdbackoffice.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Names the customer-owned DB view used to resolve game query scopes.
|
||||
*
|
||||
* <p>The view is a stable integration contract, not a Smilegate-specific table.
|
||||
* Each environment can expose its own game master, alias source, and approved
|
||||
* object inventory behind this view without changing application code.</p>
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "backoffice.game-scope")
|
||||
public record GameScopeProperties(
|
||||
boolean enabled,
|
||||
String viewName,
|
||||
int maxScopes
|
||||
) {
|
||||
|
||||
public boolean configured() {
|
||||
return enabled && viewName != null && !viewName.isBlank();
|
||||
}
|
||||
|
||||
public int resolvedMaxScopes() {
|
||||
return maxScopes >= 1 && maxScopes <= 20 ? maxScopes : 8;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user