From 0781c531010fea30a3cf4aa0c65a9f677c80338e Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 28 Dec 2025 06:11:54 -0800 Subject: [PATCH] =?UTF-8?q?fix(admin-service):=20=E4=BF=AE=E5=A4=8D=20getC?= =?UTF-8?q?urrentStatus=20=E6=96=B9=E6=B3=95=E4=BD=BF=E7=94=A8=E6=97=A7?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E6=A0=BC=E5=BC=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AdminMaintenanceController.getCurrentStatus() 方法仍使用旧的 inMaintenance 字段, 导致构建失败。更新为与 MobileMaintenanceController 一致的新格式: - 使用 isUnderMaintenance 代替 inMaintenance - 使用嵌套的 maintenance 对象包含详情 - 添加 remainingMinutes 字段计算 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../system-maintenance.controller.ts | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/backend/services/admin-service/src/api/controllers/system-maintenance.controller.ts b/backend/services/admin-service/src/api/controllers/system-maintenance.controller.ts index 211b4100..f4a1094d 100644 --- a/backend/services/admin-service/src/api/controllers/system-maintenance.controller.ts +++ b/backend/services/admin-service/src/api/controllers/system-maintenance.controller.ts @@ -176,14 +176,24 @@ export class AdminMaintenanceController { const active = await this.maintenanceRepo.findActiveMaintenance(); if (!active) { - return { inMaintenance: false }; + return { isUnderMaintenance: false, maintenance: null }; } + // 计算剩余分钟数 + const now = new Date(); + const endTime = new Date(active.endTime); + const remainingMs = endTime.getTime() - now.getTime(); + const remainingMinutes = Math.max(0, Math.ceil(remainingMs / 60000)); + return { - inMaintenance: true, - title: active.title, - message: active.message, - endTime: active.endTime, + isUnderMaintenance: true, + maintenance: { + title: active.title, + message: active.message, + startTime: active.startTime, + endTime: active.endTime, + remainingMinutes, + }, }; } }