fix: notification click navigates to related page, report interpretation notifies patient
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user