From ff45c5994692cfa833039dd87176fde15dc5fa91 Mon Sep 17 00:00:00 2001 From: huang <1724659546@qq.com> Date: Wed, 29 Oct 2025 19:07:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/app/controller/plan/plan_controller.go | 2 +- internal/app/service/monitor_service.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/app/controller/plan/plan_controller.go b/internal/app/controller/plan/plan_controller.go index 1671d96..b682227 100644 --- a/internal/app/controller/plan/plan_controller.go +++ b/internal/app/controller/plan/plan_controller.go @@ -166,7 +166,7 @@ func (c *Controller) ListPlans(ctx *gin.Context) { } // 1. 调用仓库层获取所有计划 - opts := repository.ListPlansOptions{PlanType: repository.PlanTypeFilter(query.PlanType)} + opts := repository.ListPlansOptions{PlanType: query.PlanType} plans, total, err := c.planRepo.ListPlans(opts, query.Page, query.PageSize) if err != nil { c.logger.Errorf("%s: 数据库查询失败: %v", actionType, err) diff --git a/internal/app/service/monitor_service.go b/internal/app/service/monitor_service.go index ba282c7..e318f19 100644 --- a/internal/app/service/monitor_service.go +++ b/internal/app/service/monitor_service.go @@ -98,10 +98,14 @@ func (s *monitorService) ListPlanExecutionLogs(opts repository.PlanExecutionLogL } planIds := []uint{} for _, datum := range planLogs { + has := false for _, id := range planIds { if id == datum.PlanID { + has = true break } + } + if !has { planIds = append(planIds, datum.PlanID) } }