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:
53
backend/src/Health.Domain/Entities/consultation.cs
Normal file
53
backend/src/Health.Domain/Entities/consultation.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Health.Domain.Enums;
|
||||
|
||||
namespace Health.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 问诊会话
|
||||
/// </summary>
|
||||
public sealed class Consultation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public Guid DoctorId { get; set; }
|
||||
public ConsultationStatus Status { get; set; }
|
||||
public int Month { get; set; } // 所属月份,用于配额计算
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? ClosedAt { get; set; }
|
||||
|
||||
public User User { get; set; } = null!;
|
||||
public Doctor Doctor { get; set; } = null!;
|
||||
public ICollection<ConsultationMessage> Messages { get; set; } = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 问诊消息
|
||||
/// </summary>
|
||||
public sealed class ConsultationMessage
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ConsultationId { get; set; }
|
||||
public ConsultationSenderType SenderType { get; set; }
|
||||
public string? SenderName { get; set; }
|
||||
public string Content { get; set; } = string.Empty;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public Consultation Consultation { get; set; } = null!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 医生
|
||||
/// </summary>
|
||||
public sealed class Doctor
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Title { get; set; } // 主任医师/副主任医师
|
||||
public string? Department { get; set; } // 心血管内科/营养科
|
||||
public string? AvatarUrl { get; set; }
|
||||
public string? Introduction { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<Consultation> Consultations { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user