package com.smyhub.infogenie.infogeniebackendjava.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Binds all app.* keys from application.yaml to a strongly-typed bean.
 * Inject this anywhere you need application-level configuration.
 */
@Data
@Component
@ConfigurationProperties(prefix = "app")
public class AppProperties {

    /** External auth-center base URL used to verify Bearer tokens. */
    private String authCenterUrl = "https://auth.api.shumengya.top";

    /** Shared secret for /api/admin/* endpoints (X-Site-Admin-Token header). */
    private String siteAdminToken = "";

    /** Whether Redis caching is enabled. */
    private boolean redisEnabled = false;

    /** Prefix prepended to every Redis key written by this service. */
    private String redisKeyPrefix = "infogenie:java:";

    /** Default TTL in seconds for cached site-config entries. */
    private long redisSiteTtl = 300L;
}
