Files
schedule_converter/config/config.go

28 lines
691 B
Go
Raw Normal View History

2026-03-13 20:43:44 +08:00
package config
import (
"os"
)
// 配置变量
var (
BaseURL = getEnv("JWTS_BASE_URL", "http://jwts.hitwh.edu.cn")
Username = getEnv("JWTS_USERNAME", "")
Password = getEnv("JWTS_PASSWORD", "")
Semester = getEnv("JWTS_SEMESTER", "2025-20262")
TWFID = getEnv("JWTS_TWFID", "")
RecognizerAPIURL = getEnv("RECOGNIZER_API_URL", "https://api.littlelan.cn/v1/chat/completions")
RecognizerAPIKey = getEnv("RECOGNIZER_API_KEY", "")
RecognizerModel = getEnv("RECOGNIZER_MODEL", "qwen3.5-plus")
2026-03-13 20:43:44 +08:00
)
// getEnv 从环境变量获取配置,提供默认值
func getEnv(key, defaultValue string) string {
value := os.Getenv(key)
if value == "" {
return defaultValue
}
return value
}