支持手动指定品种和日期进行打分
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -7,21 +7,23 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
ListenAddr string
|
||||
DatabaseURL string
|
||||
AuthDBPath string
|
||||
JWTSecret []byte
|
||||
AdminUser string
|
||||
AdminPass string
|
||||
ListenAddr string
|
||||
DatabaseURL string
|
||||
AuthDBPath string
|
||||
JWTSecret []byte
|
||||
AdminUser string
|
||||
AdminPass string
|
||||
TushareAPIURL string
|
||||
}
|
||||
|
||||
func Load() (*Config, error) {
|
||||
cfg := &Config{
|
||||
ListenAddr: getenv("LISTEN_ADDR", ":8080"),
|
||||
DatabaseURL: os.Getenv("DATABASE_URL"),
|
||||
AuthDBPath: getenv("AUTH_DB_PATH", "/app/auth/auth.db"),
|
||||
AdminUser: strings.TrimSpace(os.Getenv("ADMIN_USER")),
|
||||
AdminPass: os.Getenv("ADMIN_PASS"),
|
||||
ListenAddr: getenv("LISTEN_ADDR", ":8080"),
|
||||
DatabaseURL: os.Getenv("DATABASE_URL"),
|
||||
AuthDBPath: getenv("AUTH_DB_PATH", "/app/auth/auth.db"),
|
||||
AdminUser: strings.TrimSpace(os.Getenv("ADMIN_USER")),
|
||||
AdminPass: os.Getenv("ADMIN_PASS"),
|
||||
TushareAPIURL: getenv("TUSHARE_API_URL", "http://tushare:8000"),
|
||||
}
|
||||
if cfg.DatabaseURL == "" {
|
||||
return nil, fmt.Errorf("DATABASE_URL 环境变量未设置")
|
||||
|
||||
Reference in New Issue
Block a user