using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace HealthMonitor.Model.Cache { public class Person { [JsonProperty("personId")] public string PersonId { get; set; } = default!; [JsonProperty("deviceId")] public string DeviceId { get; set; } = default!; [JsonProperty("serialno")] public string SerialNo { get; set; } = default!; [JsonProperty("remarks")] public string Remarks { get; set; } = default!; [JsonProperty("ishypertension")] public bool Ishypertension { get; set; } = default!; [JsonProperty("personName")] public string PersonName { get; set; } = default!; [JsonProperty("gender")] public bool Gender { get; set; } = default!; // 用于存储真实值的字段 // private bool gender; //public int Age //{ // get // { // DateTime bornDate = DateTime.Parse(BornDate); // int age = DateTime.Today.Year - bornDate.Year; // if (bornDate > DateTime.Today.AddYears(-age)) age--; // return age; // } // set // { // BornDate = DateTime.Today.AddYears(-value).ToShortDateString(); // } //} [JsonProperty("age")] public int Age { get; set; } = default!; [JsonProperty("bornDate")] public DateTime? BornDate { get; set; } = default!; [JsonProperty("height")] public int Height { get; set; } = default!; [JsonProperty("weight")] public int Weight { get; set; } = default!; } public class GpsDevicePerson { [JsonProperty("person")] public Person Person { get; set; } = default!; [JsonProperty("time")] public DateTime Time { get; set; } = default!; } }