feat: 医生端Web后台 + SignalR实时问诊

- 新增 doctor_web/ React前端 (dashboard/患者/问诊/报告/随访)
- 后端新增 doctor_endpoints (14个医生API) + ConsultationHub (SignalR)
- Flutter端 SignalR 替换轮询实现实时聊天
This commit is contained in:
MingNian
2026-06-05 17:46:07 +08:00
parent 20a5ce1199
commit d0d7d8428d
41 changed files with 5892 additions and 18 deletions

View File

@@ -87,14 +87,16 @@ builder.Services.AddHostedService<CleanupService>();
// ---- OpenAPI ----
builder.Services.AddOpenApi();
// ---- CORS ----
// ---- SignalR ----
builder.Services.AddSignalR();
// ---- CORSSignalR 需要明确 origins + AllowCredentials----
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
{
policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader();
policy.SetIsOriginAllowed(_ => true).AllowAnyMethod().AllowAnyHeader().AllowCredentials();
});
// 生产环境policy.WithOrigins("https://yourdomain.com").AllowAnyMethod().AllowAnyHeader();
});
var app = builder.Build();
@@ -129,5 +131,9 @@ app.MapUserEndpoints();
app.MapAiChatEndpoints();
app.MapFileEndpoints();
app.MapCalendarEndpoints();
app.MapDoctorEndpoints();
// SignalR Hub
app.MapHub<Health.WebApi.Hubs.ConsultationHub>("/hubs/consultation");
app.Run();