- Backend: .NET 10 Minimal API + EF Core + PostgreSQL - Frontend: Flutter + Riverpod + GoRouter + Dio - AI: DeepSeek LLM + Qwen VLM (OpenAI-compatible) - Auth: SMS + JWT (access/refresh tokens) - Features: AI chat, health tracking, medication management, diet analysis, exercise plans, doctor consultations, report analysis
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using Health.Domain.Enums;
|
|
|
|
namespace Health.Domain.Entities;
|
|
|
|
/// <summary>
|
|
/// 饮食记录
|
|
/// </summary>
|
|
public sealed class DietRecord
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid UserId { get; set; }
|
|
public MealType MealType { get; set; }
|
|
public int? TotalCalories { get; set; }
|
|
public int? HealthScore { get; set; } // 1-5 星
|
|
public DateOnly RecordedAt { get; set; }
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
public User User { get; set; } = null!;
|
|
public ICollection<DietFoodItem> FoodItems { get; set; } = [];
|
|
}
|
|
|
|
/// <summary>
|
|
/// 饮食记录中的食物条目
|
|
/// </summary>
|
|
public sealed class DietFoodItem
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid DietRecordId { get; set; }
|
|
public string Name { get; set; } = string.Empty;
|
|
public string? Portion { get; set; }
|
|
public int? Calories { get; set; }
|
|
public decimal? ProteinGrams { get; set; }
|
|
public decimal? CarbsGrams { get; set; }
|
|
public decimal? FatGrams { get; set; }
|
|
public string? Warning { get; set; }
|
|
public int SortOrder { get; set; }
|
|
|
|
public DietRecord DietRecord { get; set; } = null!;
|
|
}
|