feat: ticket enhancemnet

This commit is contained in:
zhangsz
2025-07-02 17:22:35 +08:00
parent 24ed4e874a
commit 758276ecfc
11 changed files with 577 additions and 108 deletions

View File

@@ -126,6 +126,11 @@ type YamlConfig struct {
Enabled bool `yaml:"enabled"`
File string `yaml:"file"`
} `yaml:"testConfig"`
PsapConfig struct {
Enabled bool `yaml:"enabled"`
File string `yaml:"file"`
} `yaml:"psapConfig"`
}
type RestParam struct {
@@ -253,6 +258,16 @@ func NewYamlConfig() YamlConfig {
}
}
// InitPsapConfig 初始化PSAP配置
func InitPsapConfig() error {
if !yamlConfig.PsapConfig.Enabled {
return nil
}
_, err := ReadPsapConfig(yamlConfig.PsapConfig.File)
return err
}
func ReadConfig(configFile string) {
YamlConfigInfo.FilePath = configFile
@@ -270,6 +285,11 @@ func ReadConfig(configFile string) {
}
yamlConfig = YamlConfigInfo.ConfigLines
// 初始化PSAP配置
if err := InitPsapConfig(); err != nil {
fmt.Printf("Failed to load PSAP config: %v\n", err)
}
ReadOriginalConfig(configFile)
}