feat: AI 对话附件上下文解析 + 历史会话归档 + 多页面 UI 重构

- 后端: 新增 AttachmentContextBuilder 解析图片/PDF 摘要并拼入 LLM 上下文; ai_chat_endpoints 扩展附件接口; 新增 ReportAnalysisService
- 前端: 新增历史会话页与 conversation_history_provider; chat 链路支持附件展示与回放
- UI: 重构 medication_checkin / notification_center / profile / health_drawer 等多页面
- 配置: api_client baseUrl 适配当前 WiFi IP
This commit is contained in:
MingNian
2026-07-06 12:44:59 +08:00
parent 4507083f3f
commit 7a93237069
38 changed files with 4165 additions and 1157 deletions

View File

@@ -3,6 +3,7 @@ using Health.Application.Calendars;
using Health.Application.HealthArchives;
using Health.Application.HealthRecords;
using Health.Application.Exercises;
using Health.Domain;
using Health.Domain.Entities;
using Health.Domain.Enums;
@@ -167,6 +168,26 @@ public sealed class ApplicationServiceTests
Assert.Equal(2, current.Items.Count);
}
[Fact]
public async Task ExercisePlan_CheckInRejectsNonTodayItem()
{
var today = DateOnly.FromDateTime(DateTime.UtcNow.AddHours(8));
var repository = new FakeExerciseRepository();
var plan = new ExercisePlan
{
Id = Guid.NewGuid(), UserId = Guid.NewGuid(), StartDate = today.AddDays(-1), EndDate = today, ReminderTime = new TimeOnly(19, 0),
};
var item = new ExercisePlanItem
{
Id = Guid.NewGuid(), Plan = plan, ScheduledDate = today.AddDays(-1), ExerciseType = "散步", DurationMinutes = 30,
};
plan.Items.Add(item);
repository.SetPlan(plan);
var service = new ExerciseService(repository);
await Assert.ThrowsAsync<ValidationException>(() => service.ToggleCheckInAsync(plan.UserId, item.Id, CancellationToken.None));
}
private sealed class FakeHealthArchiveRepository(HealthArchive? archive) : IHealthArchiveRepository
{
public HealthArchive? Archive { get; private set; } = archive;