package com.agileboot.common.satoken.config;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import jakarta.annotation.PostConstruct;

/**
 * 公开接口配置 - 统一管理无需登录的接口
 * 支持从yml配置文件读取，更加灵活
 * 
 * @author agileboot
 */
@Component
@RequiredArgsConstructor
public class PublicUrlsConfig {

    private final PublicUrlsProperties properties;

    /**
     * 公开接口列表 - 从yml配置读取
     */
    private static String[] publicUrls;

    @PostConstruct
    public void init() {
        publicUrls = properties.getUrlsArray();
    }

    /**
     * 获取公开URL列表
     */
    public static String[] getPublicUrls() {
        return publicUrls;
    }
}

