fix: complete nested portrait views and binding alert scope

This commit is contained in:
Yvan
2026-11-05 16:55:13 +08:00
parent db11b6eb54
commit a43d140339
9 changed files with 63 additions and 8 deletions
@@ -35,6 +35,9 @@ func (s *AlertRecordService) List(ctx context.Context, req *dto.AlertRecordQuery
if req == nil {
return nil, business.ErrAlertRecordInput
}
if req.PlatformBusierID != nil && *req.PlatformBusierID == 0 {
return nil, business.ErrAlertRecordInput
}
if req.MonitorMetric != nil && (*req.MonitorMetric < 1 || *req.MonitorMetric > 3) {
return nil, business.ErrAlertRecordInput
}
@@ -56,6 +59,7 @@ func (s *AlertRecordService) List(ctx context.Context, req *dto.AlertRecordQuery
}
filter := business.AlertRecordFilter{TargetPromoteID: req.TargetPromoteID, BusinessID: req.BusinessID, TargetPromoteName: strings.TrimSpace(req.TargetPromoteName), RuleName: strings.TrimSpace(req.RuleName), RuleType: strings.TrimSpace(req.RuleType), BusinessName: strings.TrimSpace(req.BusinessName), MonitorMetric: req.MonitorMetric, Status: req.Status}
seen := map[string]bool{}
filter.PlatformBusierID = req.PlatformBusierID
for _, code := range strings.Split(req.PlatformCodes, ",") {
code = strings.TrimSpace(code)
if code != "" && !seen[code] {
+1
View File
@@ -7,6 +7,7 @@ type AlertRecordQuery struct {
PageSize int `form:"pageSize"`
PlatformCodes string `form:"platformCodes"`
TargetPromoteID *uint64 `form:"targetPromoteId"`
PlatformBusierID *uint64 `form:"platformBusierId"`
BusinessID *uint `form:"businessId"`
TargetPromoteName string `form:"targetPromoteName"`
RuleName string `form:"ruleName"`