feat: ticket enhancemnet
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user