fix(admin-service): 修复 getCurrentStatus 方法使用旧响应格式的问题
AdminMaintenanceController.getCurrentStatus() 方法仍使用旧的 inMaintenance 字段, 导致构建失败。更新为与 MobileMaintenanceController 一致的新格式: - 使用 isUnderMaintenance 代替 inMaintenance - 使用嵌套的 maintenance 对象包含详情 - 添加 remainingMinutes 字段计算 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6c4a40c42d
commit
0781c53101
|
|
@ -176,14 +176,24 @@ export class AdminMaintenanceController {
|
||||||
const active = await this.maintenanceRepo.findActiveMaintenance();
|
const active = await this.maintenanceRepo.findActiveMaintenance();
|
||||||
|
|
||||||
if (!active) {
|
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 {
|
return {
|
||||||
inMaintenance: true,
|
isUnderMaintenance: true,
|
||||||
title: active.title,
|
maintenance: {
|
||||||
message: active.message,
|
title: active.title,
|
||||||
endTime: active.endTime,
|
message: active.message,
|
||||||
|
startTime: active.startTime,
|
||||||
|
endTime: active.endTime,
|
||||||
|
remainingMinutes,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue