feat: 医生端完整实现 + 双角色登录 + 健康日历 + 饮食记录重做 + 配色系统重构
后端: - User表加Role字段 + DoctorProfile表 + 废弃旧Doctor数据 - JWT加Role claim + 注册/登录拆分(/api/auth/register + /api/auth/login) - 医生端点全量加JWT鉴权+Role校验(15个端点) - 日历端点改造(用药/运动/随访按日期+星期匹配) - 饮食记录PUT端点 + 健康记录DELETE端点 - 用户Profile端点返回Role 前端: - 登录页重做(角色选择卡片 用户紫/医生蓝 + 审核码6666 + 注册返登录) - App路由分流(userRole→患者端/医生端) - 医生端: 工作台Dashboard + 患者管理(搜索分页) + 问诊/报告/随访CRUD - 报告审核: AI预分析+指标表格+严重程度4级+模板多选+评语 - 随访编辑: 患者选择器+日期时间+打通患者端 - 健康日历: 可点击日历+当日安排列表+用药/运动/随访颜色标记 - 饮食记录: 热量趋势7/30天+日历(一周)+当日胶囊详情+侧滑编辑删除 - 健康档案: 日期选择器+手术可添加多条+白底渐变保存按钮 - 配色系统: 清理25个未使用色+新增doctorBlue/drawerGradient/pageGrey - 患者端侧边栏: 新渐变+白底按钮+紫色汉堡图标 - AI对话: 用户气泡白底黑字+药管家改蓝色 - App启动闪屏: 防登录页闪烁 文档: color_design_system.md(20页面完整配色设计+图标底色对照表)
This commit is contained in:
@@ -24,6 +24,7 @@ public sealed class AppDbContext(DbContextOptions<AppDbContext> options) : DbCon
|
||||
public DbSet<Consultation> Consultations => Set<Consultation>();
|
||||
public DbSet<ConsultationMessage> ConsultationMessages => Set<ConsultationMessage>();
|
||||
public DbSet<Doctor> Doctors => Set<Doctor>();
|
||||
public DbSet<DoctorProfile> DoctorProfiles => Set<DoctorProfile>();
|
||||
public DbSet<FollowUp> FollowUps => Set<FollowUp>();
|
||||
public DbSet<HealthArchive> HealthArchives => Set<HealthArchive>();
|
||||
|
||||
@@ -41,6 +42,14 @@ public sealed class AppDbContext(DbContextOptions<AppDbContext> options) : DbCon
|
||||
builder.Entity<User>(e =>
|
||||
{
|
||||
e.HasIndex(u => u.Phone).IsUnique();
|
||||
e.Property(u => u.Role).HasMaxLength(32).HasDefaultValue("User");
|
||||
});
|
||||
|
||||
// ---- DoctorProfile ----
|
||||
builder.Entity<DoctorProfile>(e =>
|
||||
{
|
||||
e.HasIndex(d => d.UserId).IsUnique();
|
||||
e.HasOne(d => d.User).WithOne(u => u.DoctorProfile).HasForeignKey<DoctorProfile>(d => d.UserId);
|
||||
});
|
||||
|
||||
// ---- HealthRecord ----
|
||||
|
||||
@@ -7,39 +7,7 @@ public static class DataSeeder
|
||||
{
|
||||
public static async Task SeedAsync(AppDbContext db)
|
||||
{
|
||||
// 种子医生数据(固定 ID,与客户端 fallback 保持一致)
|
||||
if (!db.Doctors.Any())
|
||||
{
|
||||
db.Doctors.AddRange(
|
||||
new Doctor
|
||||
{
|
||||
Id = Guid.Parse("ef0953c9-eb63-4d03-b6d7-050a1897d4a3"),
|
||||
Name = "王建国",
|
||||
Title = "主任医师",
|
||||
Department = "心血管内科",
|
||||
Introduction = "擅长冠心病术后管理、心脏康复指导",
|
||||
IsActive = true
|
||||
},
|
||||
new Doctor
|
||||
{
|
||||
Id = Guid.Parse("d4148733-b538-4398-af17-0c7592fc0c2d"),
|
||||
Name = "李芳",
|
||||
Title = "副主任医师",
|
||||
Department = "营养科",
|
||||
Introduction = "擅长术后营养指导、膳食规划",
|
||||
IsActive = true
|
||||
},
|
||||
new Doctor
|
||||
{
|
||||
Id = Guid.Parse("468b82e2-d95a-4436-bff6-a50eecf99a66"),
|
||||
Name = "张明",
|
||||
Title = "主任医师",
|
||||
Department = "心脏康复科",
|
||||
Introduction = "擅长心脏术后运动康复、心肺功能评估",
|
||||
IsActive = true
|
||||
}
|
||||
);
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
// 医生不再使用种子数据,通过注册创建
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user