package com.seer.teach.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;
import java.util.List;

@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "seer.auth")
public class AuthProperties {

    // 鉴权总开关
    private boolean enabled = true;

    // 鉴权接口
    private String authApi = "http://seer-admin/seer/user/getUserPermissionByUserId";

    // 鉴权接口
    private String signApi = "http://seer-open-api/seer/open/rest/sign";

    // 排除鉴权的路径模式（支持Ant风格）
    private List<String> excludePatterns = Arrays.asList("/seer/admin/user/login", "/seer/user/app/auth/wx/login", "/seer/user/app/auth/account/login");

    // 缓存配置
    private CacheConfig cache = new CacheConfig();

    @Getter
    @Setter
    public static class CacheConfig {
        private long localExpireMinutes = 10;
        private long redisExpireHours = 1;
        private int maxSize = 1000;
    }
}