feat: add openim info test

This commit is contained in:
Xinwei Xiong(cubxxw)
2023-11-09 18:14:59 +08:00
parent 88dcbc5c31
commit 1b3c69d709
5 changed files with 124 additions and 103 deletions
+4 -2
View File
@@ -49,7 +49,7 @@ func GetDefaultConfigPath() string {
func GetProjectRoot() string {
b, _ := filepath.Abs(os.Args[0])
return filepath.Join(filepath.Dir(b), "../../..")
return filepath.Join(filepath.Dir(b), "../../../../..")
}
func GetOptionsByNotification(cfg NotificationConf) msgprocessor.Options {
@@ -67,6 +67,7 @@ func GetOptionsByNotification(cfg NotificationConf) msgprocessor.Options {
opts = msgprocessor.WithOptions(opts, msgprocessor.WithHistory(true), msgprocessor.WithPersistent())
}
opts = msgprocessor.WithOptions(opts, msgprocessor.WithSendMsg(cfg.IsSendMsg))
return opts
}
@@ -89,6 +90,7 @@ func initConfig(config interface{}, configName, configFolderPath string) error {
return fmt.Errorf("unmarshal yaml error: %w", err)
}
fmt.Println("use config", configFolderPath)
return nil
}
@@ -107,4 +109,4 @@ func InitConfig(configFolderPath string) error {
}
return initConfig(&Config.Notification, NotificationFileName, configFolderPath)
}
}