This commit is contained in:
2026-07-24 23:27:17 +08:00
parent b935c557b9
commit cc2513652e
17 changed files with 1600 additions and 7 deletions

View File

@@ -47,6 +47,7 @@ type Config struct {
Huibo HuiboConfig `mapstructure:"huibo"`
Nuoer NuoerConfig `mapstructure:"nuoer"`
Haiyuapi HaiyuapiConfig `mapstructure:"haiyuapi"`
Yuyuecha YuyuechaConfig `mapstructure:"yuyuecha"`
QueryWhitelist QueryWhitelistConfig `mapstructure:"query_whitelist"`
}
@@ -775,6 +776,34 @@ type HaiyuapiLevelFileConfig struct {
Compress bool `mapstructure:"compress"`
}
// YuyuechaConfig 愉悦查 OpenAPI 配置
type YuyuechaConfig struct {
BaseURL string `mapstructure:"base_url"`
ClientID string `mapstructure:"client_id"`
ClientSecret string `mapstructure:"client_secret"`
Timeout time.Duration `mapstructure:"timeout"`
Logging YuyuechaLoggingConfig `mapstructure:"logging"`
}
// YuyuechaLoggingConfig 愉悦查日志配置
type YuyuechaLoggingConfig struct {
Enabled bool `mapstructure:"enabled"`
LogDir string `mapstructure:"log_dir"`
ServiceName string `mapstructure:"service_name"`
UseDaily bool `mapstructure:"use_daily"`
EnableLevelSeparation bool `mapstructure:"enable_level_separation"`
LevelConfigs map[string]YuyuechaLevelFileConfig `mapstructure:"level_configs"`
}
// YuyuechaLevelFileConfig 愉悦查级别文件配置
type YuyuechaLevelFileConfig struct {
MaxSize int `mapstructure:"max_size"`
MaxBackups int `mapstructure:"max_backups"`
MaxAge int `mapstructure:"max_age"`
Compress bool `mapstructure:"compress"`
}
// DomainConfig 域名配置
type DomainConfig struct {
API string `mapstructure:"api"` // API域名