feat: 通知推送/免打扰偏好 + 饮食记录侧滑删除修复 + 聊天交互优化
- 通知: 新增推送开关/免打扰时段偏好持久化 + EF 迁移; 通知管线支持免打扰过滤 - 饮食: 侧滑删除 confirmDismiss 按方向放行(修复删不掉); 新增 diet_nutrition_widgets; 饮食录入页重构 - 聊天: 智能体胶囊点击锁防误触; 流式状态 select 优化; 卡片入场动画 - 主页: 消息列表提取 _HomeMessages + 侧滑手势打开抽屉 - 其他: api_client IP 适配; 通知/用药/饮食端点微调; 测试更新
This commit is contained in:
@@ -26,8 +26,10 @@ public static class DietEndpoints
|
||||
group.MapDelete("/{id:guid}", async (Guid id, HttpContext http, IDietService diets, CancellationToken ct) =>
|
||||
{
|
||||
var userId = GetUserId(http);
|
||||
await diets.DeleteAsync(userId, id, ct);
|
||||
return Results.Ok(new { code = 0, data = new { success = true }, message = (string?)null });
|
||||
var deleted = await diets.DeleteAsync(userId, id, ct);
|
||||
return deleted
|
||||
? Results.Ok(new { code = 0, data = new { success = true }, message = (string?)null })
|
||||
: Results.Ok(new { code = 40004, data = (object?)null, message = "饮食记录不存在" });
|
||||
});
|
||||
|
||||
group.MapPut("/{id:guid}", async (Guid id, HttpContext http, IDietService diets, CancellationToken ct) =>
|
||||
|
||||
@@ -36,8 +36,10 @@ public static class MedicationEndpoints
|
||||
group.MapDelete("/{id:guid}", async (Guid id, HttpContext http, IMedicationService medications, CancellationToken ct) =>
|
||||
{
|
||||
var userId = GetUserId(http);
|
||||
await medications.DeleteAsync(userId, id, ct);
|
||||
return Results.Ok(new { code = 0, data = new { success = true }, message = (string?)null });
|
||||
var deleted = await medications.DeleteAsync(userId, id, ct);
|
||||
return deleted
|
||||
? Results.Ok(new { code = 0, data = new { success = true }, message = (string?)null })
|
||||
: Results.Ok(new { code = 40004, data = (object?)null, message = "用药记录不存在" });
|
||||
});
|
||||
|
||||
group.MapPost("/{id:guid}/confirm", async (Guid id, HttpContext http, IMedicationService medications, CancellationToken ct) =>
|
||||
|
||||
@@ -90,6 +90,10 @@ public static class NotificationEndpoints
|
||||
if (body.FollowUpReminder.HasValue) pref.FollowUpReminder = body.FollowUpReminder.Value;
|
||||
if (body.DoctorReply.HasValue) pref.DoctorReply = body.DoctorReply.Value;
|
||||
if (body.AbnormalAlert.HasValue) pref.AbnormalAlert = body.AbnormalAlert.Value;
|
||||
if (body.PushEnabled.HasValue) pref.PushEnabled = body.PushEnabled.Value;
|
||||
if (body.DndEnabled.HasValue) pref.DndEnabled = body.DndEnabled.Value;
|
||||
if (body.DndStartMinutes is >= 0 and < 1440) pref.DndStartMinutes = body.DndStartMinutes.Value;
|
||||
if (body.DndEndMinutes is >= 0 and < 1440) pref.DndEndMinutes = body.DndEndMinutes.Value;
|
||||
if (body.HealthRecordReminder.HasValue) pref.HealthRecordReminder = body.HealthRecordReminder.Value;
|
||||
if (body.HealthRecordReminderBloodPressure.HasValue) pref.HealthRecordReminderBloodPressure = body.HealthRecordReminderBloodPressure.Value;
|
||||
if (body.HealthRecordReminderHeartRate.HasValue) pref.HealthRecordReminderHeartRate = body.HealthRecordReminderHeartRate.Value;
|
||||
@@ -153,6 +157,10 @@ public static class NotificationEndpoints
|
||||
followUpReminder = pref.FollowUpReminder,
|
||||
doctorReply = pref.DoctorReply,
|
||||
abnormalAlert = pref.AbnormalAlert,
|
||||
pushEnabled = pref.PushEnabled,
|
||||
dndEnabled = pref.DndEnabled,
|
||||
dndStartMinutes = pref.DndStartMinutes,
|
||||
dndEndMinutes = pref.DndEndMinutes,
|
||||
healthRecordReminder = pref.HealthRecordReminder,
|
||||
healthRecordReminderBloodPressure = pref.HealthRecordReminderBloodPressure,
|
||||
healthRecordReminderHeartRate = pref.HealthRecordReminderHeartRate,
|
||||
@@ -167,6 +175,10 @@ public sealed record NotificationPrefsUpdateDto(
|
||||
bool? FollowUpReminder,
|
||||
bool? DoctorReply,
|
||||
bool? AbnormalAlert,
|
||||
bool? PushEnabled,
|
||||
bool? DndEnabled,
|
||||
int? DndStartMinutes,
|
||||
int? DndEndMinutes,
|
||||
bool? HealthRecordReminder,
|
||||
bool? HealthRecordReminderBloodPressure,
|
||||
bool? HealthRecordReminderHeartRate,
|
||||
|
||||
Reference in New Issue
Block a user