Files
Evergreen-Health/Evergreen.Health.Application/Health/Models/HealthModels.cs
T
2026-10-08 10:16:43 +08:00

198 lines
6.7 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace Evergreen.Health.Application.Health.Models;
public sealed class HealthRegisterInput
{
[Required, RegularExpression(@"^1[3-9]\d{9}$", ErrorMessage = "请输入正确的手机号码")]
public string Phone { get; set; } = string.Empty;
[Required, MinLength(8), MaxLength(32)]
public string Password { get; set; } = string.Empty;
[Required, MaxLength(50)]
public string DisplayName { get; set; } = string.Empty;
}
public sealed class HealthLoginInput
{
[Required]
public string Phone { get; set; } = string.Empty;
[Required]
public string Password { get; set; } = string.Empty;
}
public sealed class HealthAuthOutput
{
public string AccessToken { get; set; } = string.Empty;
public string RefreshToken { get; set; } = string.Empty;
public HealthUserOutput User { get; set; } = new();
}
public sealed class HealthUserOutput
{
public long Id { get; set; }
public string Phone { get; set; } = string.Empty;
public string DisplayName { get; set; } = string.Empty;
public string? AvatarUrl { get; set; }
}
public sealed class SaveHealthProfileInput
{
public DateTime? Birthday { get; set; }
[MaxLength(20)]
public string? Gender { get; set; }
[Range(80, 250)]
public decimal? HeightCm { get; set; }
[Range(20, 300)]
public decimal? WeightKg { get; set; }
[Range(0, 24)]
public decimal? AverageSleepHours { get; set; }
[Range(0, 1440)]
public int? DailyExerciseMinutes { get; set; }
[MaxLength(500)]
public string? DietPreference { get; set; }
[MaxLength(500)]
public string? HealthGoal { get; set; }
}
public sealed class SaveHealthModulesInput
{
[Required, MinLength(1)]
public List<string> ModuleCodes { get; set; } = [];
}
public sealed class HealthPlanItemOutput
{
public string ModuleCode { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string Target { get; set; } = string.Empty;
public string Advice { get; set; } = string.Empty;
}
public sealed class HealthPlanOutput
{
public long Id { get; set; }
public int Version { get; set; }
public string Title { get; set; } = string.Empty;
public string Summary { get; set; } = string.Empty;
public DateTime CreateTime { get; set; }
public List<HealthPlanItemOutput> Items { get; set; } = [];
}
public sealed class HealthDashboardOutput
{
public HealthUserOutput User { get; set; } = new();
public SaveHealthProfileInput? Profile { get; set; }
public List<string> SelectedModules { get; set; } = [];
public HealthPlanOutput? CurrentPlan { get; set; }
public bool HasCompletedAssessment { get; set; }
public decimal? Bmi { get; set; }
public string BmiStatus { get; set; } = string.Empty;
public PersonalizedSceneConfig? SceneConfig { get; set; }
public TcmAssessmentResult? TcmResult { get; set; }
public MattressComfortOutput? MattressComfort { get; set; }
}
public sealed class MattressComfortOutput
{
public decimal? Bmi { get; set; }
public string? Firmness { get; set; }
public int HeatingLevel { get; set; }
public bool IsWinter { get; set; }
public double? OutdoorTemperatureCelsius { get; set; }
public double? FeelsLikeCelsius { get; set; }
public bool WeatherAvailable { get; set; }
public string? WeatherObservedAt { get; set; }
public string WeatherReason { get; set; } = string.Empty;
public string FirmnessReason { get; set; } = string.Empty;
}
public sealed class TcmAssessmentInput
{
public Dictionary<string, string> Answers { get; set; } = new();
public Dictionary<string, string> Notes { get; set; } = new();
}
public sealed class TcmAssessmentResult
{
public bool HasCompleted { get; set; }
public string ConstitutionCode { get; set; } = string.Empty;
public string ConstitutionName { get; set; } = string.Empty;
public string? SecondaryName { get; set; }
public string Summary { get; set; } = string.Empty;
public string AromaRecommendation { get; set; } = string.Empty;
public string MusicRecommendation { get; set; } = string.Empty;
public string RoomTemperatureRecommendation { get; set; } = string.Empty;
public Dictionary<string, int> Scores { get; set; } = new();
public Dictionary<string, string> Answers { get; set; } = new();
public Dictionary<string, string> Notes { get; set; } = new();
public PersonalizedSceneConfig SceneConfig { get; set; } = new();
public DateTime? AssessedAt { get; set; }
}
public sealed class PersonalizedSceneConfig
{
public int TargetHumidity { get; set; } = 55;
public string DehumidifierMode { get; set; } = "睡眠";
public string FanLevel { get; set; } = "1档";
public bool EnableUv { get; set; } = false;
public int LightBrightnessPercent { get; set; } = 20;
public int LightColorTemperatureKelvin { get; set; } = 2700;
public decimal MattressTargetTemp { get; set; } = 36m;
public int MattressLeftFirmness { get; set; } = 5;
public int MattressRightFirmness { get; set; } = 6;
public int MattressHeatingLevel { get; set; } = 1;
public string MattressMode { get; set; } = "智能适配";
public bool EnableFragrance { get; set; } = true;
public int FragranceLevel { get; set; } = 1;
public bool EnableSpeakerSleepMode { get; set; } = true;
public string SpeakerAudioMode { get; set; } = "助眠白噪音";
public int SpeakerVolumePercent { get; set; } = 50;
}
public sealed class HealthAssessmentAnswers
{
public string SleepDuration { get; set; } = string.Empty;
public string FallingAsleepSpeed { get; set; } = string.Empty;
public string TemperaturePreference { get; set; } = string.Empty;
public string NightAwakening { get; set; } = string.Empty;
public string MattressPreference { get; set; } = string.Empty;
public string ExerciseFrequency { get; set; } = string.Empty;
public string MuscleFatigueArea { get; set; } = string.Empty;
public string ActiveTimeOfDay { get; set; } = string.Empty;
public string MealRegularity { get; set; } = string.Empty;
public string FlavorPreference { get; set; } = string.Empty;
public string LateNightEating { get; set; } = string.Empty;
public string DailyWaterIntake { get; set; } = string.Empty;
}
public sealed class SaveHealthAssessmentInput
{
public SaveHealthProfileInput BasicInfo { get; set; } = new();
public HealthAssessmentAnswers Answers { get; set; } = new();
}
public sealed class HealthAssessmentOutput
{
public bool HasCompletedAssessment { get; set; }
public SaveHealthProfileInput BasicInfo { get; set; } = new();
public HealthAssessmentAnswers Answers { get; set; } = new();
public decimal? Bmi { get; set; }
public string BmiStatus { get; set; } = "正常";
}