|
|
@@ -169,19 +169,21 @@ func (w *WeatherSceneService) checkWeatherCondition(config WeatherSceneConfig) (
|
|
|
switch config.DecisionExpr {
|
|
|
case "and":
|
|
|
for _, v := range results {
|
|
|
+ checkResult.Result = true
|
|
|
if !v {
|
|
|
checkResult.Result = false
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
- checkResult.Result = true
|
|
|
|
|
|
case "or":
|
|
|
+ checkResult.Result = false
|
|
|
for _, v := range results {
|
|
|
if v {
|
|
|
checkResult.Result = true
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
- checkResult.Result = false
|
|
|
default:
|
|
|
err = errors.New("无效的判断逻辑")
|
|
|
}
|