fix: notification click navigates to related page, report interpretation notifies patient

This commit is contained in:
MingNian
2026-05-21 15:54:16 +08:00
parent 204bc19ce5
commit bec65959a7
3 changed files with 37 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
using HealthManager.Domain.Entities;
using HealthManager.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Notification = HealthManager.Domain.Entities.Notification;
namespace HealthManager.Application.Services;
@@ -78,6 +79,16 @@ public class ReportService(AppDbContext db)
});
}
// Notify patient
db.Notifications.Add(new Notification
{
UserId = report.PatientId,
Type = "report",
Title = "报告已解读",
Content = $"您的报告「{report.Title}」已有解读结果",
RelatedId = reportId,
});
await db.SaveChangesAsync();
return report;
}