chore: 全面规范化代码,遵循 CLAUDE.md 编码规范
- C# 文件命名改为 snake_case(28 个文件重命名) - C# 类转换为主构造函数(8 个类) - 空 catch 添加异常类型(2 处) - 新建 GlobalUsings.cs(Health.Infrastructure、Health.WebApi) - Flutter 移除 go_router,改用 Riverpod 路由栈 - Flutter 移除 flutter_secure_storage,改用 sqflite 持久化 - 修复 Flutter 构建路径(Flutter SDK 迁至 D 盘) - 后端端口改为 0.0.0.0:5000,支持局域网访问
This commit is contained in:
99
backend/src/Health.Domain/Entities/support_entities.cs
Normal file
99
backend/src/Health.Domain/Entities/support_entities.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using Health.Domain.Enums;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Health.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 复查/随访计划
|
||||
/// </summary>
|
||||
public sealed class FollowUp
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string? DoctorName { get; set; }
|
||||
public string? Department { get; set; }
|
||||
public DateTime ScheduledAt { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
public FollowUpStatus Status { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public User User { get; set; } = null!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 健康档案
|
||||
/// </summary>
|
||||
public sealed class HealthArchive
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string? Diagnosis { get; set; } // 主要诊断
|
||||
public string? SurgeryType { get; set; } // 手术类型
|
||||
public DateOnly? SurgeryDate { get; set; } // 手术日期
|
||||
public List<string> Allergies { get; set; } = []; // 过敏信息
|
||||
public List<string> DietRestrictions { get; set; } = []; // 饮食限制
|
||||
public List<string> ChronicDiseases { get; set; } = []; // 慢病史
|
||||
public string? FamilyHistory { get; set; } // 家族病史
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public User User { get; set; } = null!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新令牌
|
||||
/// </summary>
|
||||
public sealed class RefreshToken
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Token { get; set; } = string.Empty;
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
public bool IsRevoked { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 短信验证码
|
||||
/// </summary>
|
||||
public sealed class VerificationCode
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
public bool IsUsed { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通知偏好
|
||||
/// </summary>
|
||||
public sealed class NotificationPreference
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public bool MedicationReminder { get; set; } = true;
|
||||
public bool FollowUpReminder { get; set; } = true;
|
||||
public bool DoctorReply { get; set; } = true;
|
||||
public bool AbnormalAlert { get; set; } = true;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public User User { get; set; } = null!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备推送 token
|
||||
/// </summary>
|
||||
public sealed class DeviceToken
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Platform { get; set; } = string.Empty; // ios / android
|
||||
public string PushToken { get; set; } = string.Empty;
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public User User { get; set; } = null!;
|
||||
}
|
||||
Reference in New Issue
Block a user