diff --git a/src/bean/entity/alert_rules.go b/src/bean/entity/alert_rules.go index e4cc8eddf81a82880d7300d038b538d01ca32d2b..984e1c9427d573c64cfcac7af3ebd57f439eb27b 100644 --- a/src/bean/entity/alert_rules.go +++ b/src/bean/entity/alert_rules.go @@ -36,8 +36,8 @@ type RulesAlertRange struct { } type AlertCondition struct { - ThresholdsMin *float64 `json:"thresholds_min" form:"thresholds_min" binding:"omitempty,required_without=Id"` - ThresholdsMax *float64 `json:"thresholds_max" form:"thresholds_max" binding:"omitempty"` + ThresholdsMin *float64 `json:"thresholds_min,omitempty" form:"thresholds_min" binding:"omitempty,required_without=ThresholdsMax"` + ThresholdsMax *float64 `json:"thresholds_max,omitempty" form:"thresholds_max" binding:"omitempty"` RiskLevel int `json:"risk_level" form:"risk_level" binding:"required,oneof=1 2 3 4"` }