feat: 医生端Web后台 + SignalR实时问诊
- 新增 doctor_web/ React前端 (dashboard/患者/问诊/报告/随访) - 后端新增 doctor_endpoints (14个医生API) + ConsultationHub (SignalR) - Flutter端 SignalR 替换轮询实现实时聊天
This commit is contained in:
@@ -87,14 +87,16 @@ builder.Services.AddHostedService<CleanupService>();
|
||||
// ---- OpenAPI ----
|
||||
builder.Services.AddOpenApi();
|
||||
|
||||
// ---- CORS ----
|
||||
// ---- SignalR ----
|
||||
builder.Services.AddSignalR();
|
||||
|
||||
// ---- CORS(SignalR 需要明确 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();
|
||||
|
||||
Reference in New Issue
Block a user