fix: complete nested portrait views and binding alert scope
This commit is contained in:
@@ -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] {
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user