feat: 蓝牙血压计BLE数据同步 + 设备管理页重构 + 健康记录滑动删除 + 医生端合并设计文档

- BLE: 修复Omron设备Indication模式连接(先订阅后配CCCD + forceIndications) + 直连重连
- BLE: 设备断连实时检测(connectionState流→Provider→UI)
- 修复: 血压数据上报后端枚举不匹配(Device→DeviceSync)导致500
- 新增: DELETE /api/health-records/{id} 后端接口
- 设备管理页: 白色主题重设计 + 直连重连 + 实时状态 + Toast通知
- 设备扫描页: 白色主题 + 扫描动画居中 + 已连接等待页面
- 健康记录: 左滑删除(Dismissible) + 同时清理_allRecords和_filtered
- 导航: 修复自定义路由栈下Navigator.pop黑屏bug
- 文档: 医生端合并App完整设计文档(已确认版)
This commit is contained in:
MingNian
2026-06-11 22:11:02 +08:00
parent 66168e3261
commit d102205b18
11 changed files with 1083 additions and 248 deletions

View File

@@ -68,6 +68,17 @@ public static class HealthEndpoints
return Results.Ok(new { code = 0, data = new { success = true }, message = (string?)null });
});
// 删除健康记录
group.MapDelete("/{id:guid}", async (Guid id, HttpContext http, AppDbContext db, CancellationToken ct) =>
{
var userId = GetUserId(http);
var record = await db.HealthRecords.FirstOrDefaultAsync(r => r.Id == id && r.UserId == userId, ct);
if (record == null) return Results.Ok(new { code = 40004, data = (object?)null, message = "记录不存在" });
db.HealthRecords.Remove(record);
await db.SaveChangesAsync(ct);
return Results.Ok(new { code = 0, data = new { success = true }, message = (string?)null });
});
// 获取各指标最新值
group.MapGet("/latest", async (HttpContext http, AppDbContext db, CancellationToken ct) =>
{