package com.iailab.sdk.auth.config; import com.iailab.sdk.auth.factory.YamlPropertySourceFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import javax.annotation.PostConstruct; /** * SDK配置文件 */ @Configuration @PropertySource( value = "classpath:application.yaml", factory = YamlPropertySourceFactory.class // 使用自定义加载器 ) public class SdkAutoConfiguration { @Value("${iailab.token.base-url}") private String baseUrl; @Value("${iailab.token.tenant-id}") public Long tenantId; @Value("${iailab.token.client-id}") public String clientId; @Value("${iailab.token.client-secret}") public String clientSecret; @Value("${iailab.token.username}") public String username; public static String BASE_URL; public static Long TENANT_ID; public static String CLIENT_ID; public static String CLIENT_SECRET; public static String USERNAME; @PostConstruct public void initUrl() { BASE_URL = this.baseUrl; TENANT_ID = this.tenantId; CLIENT_ID = this.clientId; CLIENT_SECRET = this.clientSecret; USERNAME = this.username; } }