using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using YBDevice.Body.BodyFatHelper; namespace YBDevice.NApi.Application.UserInfo { /// /// 八电极算法接口返回数据 /// public class BodyReponseInfo { /// /// 状态,1000测量成功,其他均是失败 /// public int code { get; set; } /// /// 状态 /// public string status { get; set; } /// /// 信息 /// public string message { get; set; } } /// /// 八电极算法接口返回数据 /// public class BodyReponseInfo : BodyReponseInfo { /// /// 数据 /// public List data { get; set; } } public class BodyResponseData { /// /// 参数名称 /// public string name { get; set; } /// /// 值 /// public object value { get; set; } /// /// 描述 /// public BodyResponseDataDesc description { get; set; } /// /// 单位 /// public string unit { get; set; } /// /// 标准 /// public BodyResponseDataLevel level { get; set; } } /// /// 参数描述 /// public class BodyResponseDataDesc { /// /// 描述定义 /// public string definition { get; set; } /// /// 提示 /// public string tips { get; set; } } /// /// 测量项标准 /// public class BodyResponseDataLevel { /// /// 标准值 /// public string value { get; set; } /// /// 范围 /// public List stand { get; set; } } /// /// 八电极测量历史记录 /// public class BodyMeasureHisList : UserMeasureDto { /// /// 年龄 /// public int age { get; set; } /// /// 测量时间 /// public DateTime time { get; set; } /// /// 等级标准 /// public string leveljson { get; set; } } /// /// 八电极测量历史记录 /// public class BodyMeasureHisListDto : UserMeasureDto { /// /// 年龄 /// public string age { get; set; } /// /// 测量时间 /// public string time { get; set; } } /// /// 八电极趋势信息 /// public class BodyQueryTrandDto { /// /// 家庭成员id /// public long familyid { get; set; } /// /// 开始时间 /// public DateTime? starttime { get; set; } /// /// 结束时间 /// public DateTime? endtime { get; set; } /// /// 设备类型 /// public int DevType { get; set; } = 2; } /// /// 查询趋势 /// public class TrandS2CDto { /// /// 记录ID /// public string id { get; set; } = ""; /// /// BMI /// public decimal bmi { get; set; } /// /// 脂肪率 /// public decimal fat_r { get; set; } /// /// 体重 /// public decimal weight { get; set; } /// /// 身高 /// public decimal height { get; set; } /// /// 肌肉率 /// public decimal muscle { get; set; } /// /// 测量时间 /// public string createtime { get; set; } /// ///测量时间 /// public DateTime time { get; set; } } /// /// 查询趋势 /// public class BodyTrandDto : TrandS2CDto { } /// /// 设备类型列表 /// public class UserDevTypeS2CDto { /// /// 类型名称 /// public string Name { get; set; } /// /// 类型图片 /// public string HeadImg { get; set; } /// /// 类型值 /// public int Id { get; set; } } /// /// 修改初始体重 /// public class UserFirstWeightC2SDto : IValidatableObject { /// /// 体重值 /// public decimal Weight { get; set; } /// /// 初始时间 /// public DateTime Time { get; set; } /// /// 家庭成员ID /// public int FamilyId { get; set; } /// /// 设备类型 /// public int DevType { get; set; } /// /// 验证 /// /// /// public IEnumerable Validate(ValidationContext validationContext) { if (Weight <= 0) { yield return new ValidationResult("体重值不可小于0", new[] { nameof(Weight) }); } if (FamilyId <= 0) { yield return new ValidationResult("请先选择家庭成员", new[] { nameof(FamilyId) }); } if (DevType <= 0) { yield return new ValidationResult("请先选择设备类型", new[] { nameof(DevType) }); } } } }