using Nirvana.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace YBDevice.Entity
{
    /// <summary>
    /// 添加测量记录
    /// </summary>
    public class InsertResultDataS2SDto : InsertResultC2SDto
    {
        /// <summary>
        /// 设备类型
        /// </summary>
        public int DevType { get; set; }

        /// <summary>
        /// 设备所属的服务商ID
        /// </summary>
        public int BusinessId { get; set; }

        /// <summary>
        /// 设备最近测量时间
        /// </summary>
        public DateTime? DeviceLastHeartTime { get; set; }
    }

    /// <summary>
    /// 更新用户身高资料
    /// </summary>
    public class UpdateUserHeightDataS2SDto
    {
        /// <summary>
        /// 身高值,厘米
        /// </summary>
        public decimal Height { get; set; }

        /// <summary>
        /// 家庭成员ID
        /// </summary>
        public int familyid { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public int DevType { get; set; }

        /// <summary>
        /// 最新的身高值
        /// </summary>
        public decimal LastHeight { get; set; }

        /// <summary>
        /// 最新身高测量时间
        /// </summary>
        public DateTime? LastResultHeightTime { get; set; }

        /// <summary>
        /// 半年前的身高值
        /// </summary>
        public decimal HalfYearHeight { get; set; }

        /// <summary>
        /// 一年前的身高值
        /// </summary>
        public decimal YearHeight { get; set; }
    }

    /// <summary>
    /// 更新数据
    /// </summary>
    public class UpdateRealDataS2SDtO
    {
        ///<summary>
        /// 用户是否认领,true-认领,false-不认领
        /// </summary>
        public bool IsUserTake { get; set; } = false;

        /// <summary>
        /// 体重值,单位为KG
        /// </summary>
        public decimal weight { get; set; } = 0;

        /// <summary>
        /// 身高,单位为厘米
        /// </summary>
        public decimal height { get; set; } = 0;

        /// <summary>
        /// 家庭成员ID
        /// </summary>
        public int familyid { get; set; }

        /// <summary>
        /// 测量时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserId { get; set; } = 0;

        /// <summary>
        /// 来源,1-蓝牙传输,2-手动记录,3-扫码记录
        /// </summary>
        public int SourceType { get; set; } = 1;

        /// <summary>
        /// 测量记录ID
        /// </summary>
        public Guid ResultId { get; set; }

        /// <summary>
        /// 设备ID
        /// </summary>
        public int DevId { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public int DevType { get; set; }

        /// <summary>
        /// 设备最近的测量时间
        /// </summary>
        public DateTime? DeviceLastHeartTime { get; set; }

        /// <summary>
        /// 设备所属的服务商
        /// </summary>
        public int BusinessId { get; set; }
    }

    /// <summary>
    /// 八电极数据提交
    /// </summary>
    public class MeasureBodySubmitC2SDto : MeasureSubmitS2SDto
    {
        /// <summary>
        /// 左手阻抗
        /// </summary>
        public decimal LeftHandImp { get; set; }

        /// <summary>
        /// 右手阻抗
        /// </summary>
        public decimal RightHandImp { get; set; }

        /// <summary>
        /// 左脚阻抗
        /// </summary>
        public decimal LeftFootImp { get; set; }

        /// <summary>
        /// 右脚阻抗
        /// </summary>
        public decimal RightFootImp { get; set; }

        /// <summary>
        /// 身高,单位为厘米/英尺
        /// </summary>
        public string height { get; set; }

        /// <summary>
        /// 设备类型,1-L06,2-L08
        /// </summary>
        public int Type { get; set; } = 1;

        /// <summary>
        /// 验证
        /// </summary>
        /// <param name="validationContext"></param>
        /// <returns></returns>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (familyid <= 0)
            {
                yield return new ValidationResult("请先选择家庭成员", new[] { nameof(familyid) });
            }
            if (string.IsNullOrEmpty(height) || !ValidateHeight())
            {
                yield return new ValidationResult("请先输入正确的身高值", new[] { nameof(height) });
            }
        }

        /// <summary>
        /// 身高验证
        /// </summary>
        /// <returns></returns>
        private bool ValidateHeight()
        {
            string h = height.ToLower();
            if (h.Contains("cm") || h.Contains("ft"))
            {
                return true;
            }
            decimal dh = 0;
            if (Decimal.TryParse(height, out dh) && dh > 0)
            {
                return true;
            }
            return false;
        }
    }

    /// <summary>
    /// 添加测量记录的数据
    /// </summary>
    public class MeasureSubmitS2SDto
    {
        /// <summary>
        /// 头围,cm
        /// </summary>
        public decimal Head { get; set; }

        /// <summary>
        /// 体重值,单位为KG、jin、LB、st,g
        /// </summary>
        [Required(ErrorMessage = "体重值不可小于0")]
        public string weight { get; set; }

        /// <summary>
        /// 阻抗值
        /// </summary>
        public decimal imp { get; set; } = 0;

        /// <summary>
        /// 设备码
        /// </summary>
        [Required(ErrorMessage = "设备码不可为空")]
        public string ecode { get; set; } = "";

        /// <summary>
        /// 家庭成员ID
        /// </summary>
        public int familyid { get; set; }
    }

    /// <summary>
    /// 添加测量记录,身高带有单位
    /// </summary>
    public class MeasureOfUnitSubmitModel : MeasureSubmitS2SDto, IValidatableObject
    {
        /// <summary>
        /// 身高,单位为厘米/英尺
        /// </summary>
        public string height { get; set; }

        /// <summary>
        /// 验证
        /// </summary>
        /// <param name="validationContext"></param>
        /// <returns></returns>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (familyid <= 0)
            {
                yield return new ValidationResult("请先选择家庭成员", new[] { nameof(familyid) });
            }
            if (string.IsNullOrEmpty(height) || !ValidateHeight())
            {
                yield return new ValidationResult("请先输入正确的身高值", new[] { nameof(height) });
            }
        }

        /// <summary>
        /// 身高验证
        /// </summary>
        /// <returns></returns>
        private bool ValidateHeight()
        {
            string h = height.ToLower();
            if (h.Contains("cm") || h.Contains("ft"))
            {
                return true;
            }
            decimal dh = 0;
            if (Decimal.TryParse(height, out dh) && dh > 0)
            {
                return true;
            }
            return false;
        }
    }

    /// <summary>
    /// 添加测量记录
    /// </summary>
    public class MeasureSubmitModel : MeasureSubmitS2SDto, IValidatableObject
    {
        /// <summary>
        /// 身高,单位为厘米
        /// </summary>
        [Range(50, 250, ErrorMessage = "身高值只能在50-250厘米之间")]
        public decimal height { get; set; } = 0;

        /// <summary>
        /// 验证
        /// </summary>
        /// <param name="validationContext"></param>
        /// <returns></returns>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (familyid <= 0)
            {
                yield return new ValidationResult("请先选择家庭成员", new[] { nameof(familyid) });
            }
        }
    }

    /// <summary>
    /// 添加测量记录
    /// </summary>
    public class InsertResultC2SDto
    {
        /// <summary>
        /// 头围
        /// </summary>
        public decimal Head { get; set; } = 0;

        /// <summary>
        /// 体重值,单位为KG
        /// </summary>
        public decimal weight { get; set; } = 0;

        /// <summary>
        /// 阻抗值
        /// </summary>
        public decimal imp { get; set; } = 0;

        /// <summary>
        /// 身高,单位为厘米
        /// </summary>
        public decimal height { get; set; } = 0;

        /// <summary>
        /// 设备码
        /// </summary>
        public string ecode { get; set; } = "";

        /// <summary>
        /// 家庭成员ID
        /// </summary>
        public int familyid { get; set; }

        /// <summary>
        /// 来源,1-蓝牙传输,2-手动记录,3-扫码记录
        /// </summary>
        public int SourceType { get; set; } = 1;

        /// <summary>
        /// 设备ID
        /// </summary>
        public int DevId { get; set; } = 0;

        /// <summary>
        /// 左手阻抗
        /// </summary>
        public System.Decimal LeftArmImp { get; set; } = 0;

        /// <summary>
        /// 右手阻抗
        /// </summary>
        public System.Decimal RightArmImp { get; set; } = 0;

        /// <summary>
        /// 左脚阻抗
        /// </summary>
        public System.Decimal LeftLegImp { get; set; } = 0;

        /// <summary>
        /// 右脚阻抗
        /// </summary>
        public System.Decimal RightLegImp { get; set; } = 0;

        /// <summary>
        /// 用户是否认领,true-认领,false-不认领
        /// </summary>
        public bool IsUserTake { get; set; } = true;

        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserId { get; set; } = 0;

        /// <summary>
        /// 记录ID
        /// </summary>
        public Guid ResultId { get; set; }

        /// <summary>
        /// 用户fansid
        /// </summary>
        public Guid? fansid { get; set; } = null;

        /// <summary>
        /// 订单ID
        /// </summary>
        public Guid? orderid { get; set; } = null;

        /// <summary>
        /// 公众号id
        /// </summary>
        public string publicid { get; set; } = "";

        /// <summary>
        /// 记录时间
        /// </summary>
        public DateTime? CreateTime { get; set; } = null;
    }

    /// <summary>
    /// 增加新的体脂计算
    /// </summary>
    public class MeasureCalcDto : MeasureDataSubmitModel
    {
        /// <summary>
        /// 是否重新计算肥胖等级
        /// </summary>
        public int IsCalc { get; set; } = 0;

        /// <summary>
        /// 年龄
        /// </summary>
        public int age { get; set; }

        /// <summary>
        /// 性别,1-男,2-女,0-未知
        /// </summary>
        public GenderType sex { get; set; }
    }

    /// <summary>
    /// 添加测量记录
    /// </summary>
    public class MeasureDataSubmitModel : MeasureSubmitModel
    {
        /// <summary>
        /// 体龄
        /// </summary>
        public int bodyage { get; set; } = 0;

        /// <summary>
        /// 脂肪率
        /// </summary>
        public decimal fat_r { get; set; } = 0;

        /// <summary>
        /// 肌肉率
        /// </summary>
        public decimal muscle { get; set; } = 0;

        /// <summary>
        /// 水份
        /// </summary>
        public decimal water { get; set; } = 0;

        /// <summary>
        /// 骨重
        /// </summary>
        public decimal bone { get; set; } = 0;

        /// <summary>
        /// 基础代谢
        /// </summary>
        public decimal kcal { get; set; } = 0;

        /// <summary>
        /// 内脂
        /// </summary>
        public decimal visceral { get; set; } = 0;

        /// <summary>
        /// 蛋白率
        /// </summary>
        public decimal protein { get; set; } = 0;

        /// <summary>
        /// BMI
        /// </summary>
        public decimal bmi { get; set; } = 0;

        /// <summary>
        /// 皮下脂肪
        /// </summary>
        public decimal sfr { get; set; } = 0;

        /// <summary>
        /// 肥胖等级,参考等级枚举
        /// </summary>
        public string fatlevlval { get; set; } = "";

        /// <summary>
        /// 标准体重
        /// </summary>
        public decimal StandardWeight { get; set; } = 0;

        /// <summary>
        /// 脂肪量
        /// </summary>
        public decimal fat_w { get; set; } = 0;

        /// <summary>
        /// 去脂体重
        /// </summary>
        public decimal lbm { get; set; } = 0;

        /// <summary>
        /// 肌肉量
        /// </summary>
        public decimal muscleval { get; set; } = 0;

        /// <summary>
        /// 蛋白量
        /// </summary>
        public decimal proteinval { get; set; } = 0;
    }

    /// <summary>
    /// 用户手动增加测量记录
    /// </summary>
    public class UserMeasureSubmitModel : IValidatableObject
    {
        /// <summary>
        /// 体重值,单位为KG
        /// </summary>
        public decimal weight { get; set; }

        /// <summary>
        /// 身高,CM
        /// </summary>
        public decimal Height { get; set; } = 0;

        /// <summary>
        /// 头围,CM
        /// </summary>
        public decimal Head { get; set; } = 0;

        /// <summary>
        /// 测量时间
        /// </summary>
        [Required(ErrorMessage = "请选择测量时间")]
        public string time { get; set; }

        /// <summary>
        /// 家庭成员ID
        /// </summary>
        public int familyid { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public int DevType { get; set; } = 1;

        ///<summary>
        /// 验证
        /// </summary>
        /// <param name="validationContext"></param>
        /// <returns></returns>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (familyid <= 0)
            {
                yield return new ValidationResult("请先选择家庭成员", new[] { nameof(familyid) });
            }
            if (weight <= 0)
            {
                yield return new ValidationResult("体重不可小于0", new[] { nameof(weight) });
            }
            if (time.ToDate() > DateTime.Now.Date)
            {
                yield return new ValidationResult("时间不可大于今天", new[] { nameof(time) });
            }
        }
    }

    /// <summary>
    /// 用户测量信息
    /// </summary>
    public class UserMeasureModel : MeasureStand
    {
        /// <summary>
        /// 脂肪率
        /// </summary>
        public decimal fat_r { get; set; } = 0;

        /// <summary>
        /// 肌肉率
        /// </summary>
        public decimal muscle { get; set; } = 0;

        /// <summary>
        /// 水份,重量
        /// </summary>
        public decimal water { get; set; } = 0;

        /// <summary>
        /// 骨重
        /// </summary>
        public decimal bone { get; set; } = 0;

        /// <summary>
        /// 基础代谢
        /// </summary>
        public decimal kcal { get; set; } = 0;

        /// <summary>
        /// 脂肪重量
        /// </summary>
        public decimal fat_w { get; set; } = 0;

        /// <summary>
        /// 内脂
        /// </summary>
        public decimal visceral { get; set; } = 0;

        /// <summary>
        /// 蛋白质，蛋白率,单位%
        /// </summary>
        public decimal protein { get; set; } = 0;

        /// <summary>
        /// 体龄
        /// </summary>
        public int bodyage { get; set; } = 0;

        /// <summary>
        /// BMI
        /// </summary>
        public decimal bmi { get; set; } = 0;

        /// <summary>
        /// 分数
        /// </summary>
        public decimal cmi { get; set; } = 0;

        /// <summary>
        /// 皮下脂肪率,%
        /// </summary>
        public decimal sfr { get; set; } = 0;

        /// <summary>
        /// 皮下脂肪量,KG
        /// </summary>
        public decimal sfrval { get; set; } = 0;

        /// <summary>
        /// 骨骼肌量,kg
        /// </summary>
        public decimal skeletalmuscle { get; set; } = 0;

        /// <summary>
        /// 肌肉量
        /// </summary>
        public decimal muscleval { get; set; } = 0;

        /// <summary>
        /// 蛋白量
        /// </summary>
        public decimal proteinval { get; set; } = 0;

        /// <summary>
        /// 去脂体重
        /// </summary>
        public decimal lbm { get; set; } = 0;

        /// <summary>
        /// 体型,参考体型枚举
        /// </summary>
        public string body { get; set; } = "";

        /// <summary>
        /// 肥胖等级,参考等级枚举
        /// </summary>
        public string fatlevlval { get; set; } = "";

        /// <summary>
        /// 体重
        /// </summary>
        public decimal weight { get; set; } = 0;

        /// <summary>
        /// 身高
        /// </summary>
        public decimal height { get; set; } = 0;
    }

    /// <summary>
    /// 测量项标准
    /// </summary>
    public class MeasureStand : MeasureLevel
    {
        /// <summary>
        /// 标准体重
        /// </summary>
        public string standardWeight { get; set; } = "";

        /// <summary>
        /// 脂肪率标准范围
        /// </summary>
        public string standardfat_r { get; set; } = "";

        /// <summary>
        /// 肌肉率标准范围
        /// </summary>
        public string standardmuscle { get; set; } = "";

        /// <summary>
        /// 水份标准范围
        /// </summary>
        public string standardwater { get; set; } = "";

        /// <summary>
        /// 骨重标准范围
        /// </summary>
        public string standardbone { get; set; } = "";

        /// <summary>
        /// 基础代谢标准范围
        /// </summary>
        public string standardkcal { get; set; } = "";

        /// <summary>
        /// 脂肪重量标准范围
        /// </summary>
        public string standardfat_w { get; set; } = "";

        /// <summary>
        /// 内脂标准范围
        /// </summary>
        public string standardviscera { get; set; } = "";

        /// <summary>
        /// 蛋白质标准范围
        /// </summary>
        public string standardprotein { get; set; } = "";

        /// <summary>
        /// 体龄
        /// </summary>
        public string standardbodyage { get; set; } = "";

        /// <summary>
        /// bmi标准范围
        /// </summary>
        public string standardbmi { get; set; } = "";

        /// <summary>
        /// 皮下脂肪标准范围
        /// </summary>
        public string standardsfr { get; set; } = "";

        /// <summary>
        /// 体型标准范围
        /// </summary>
        public string standardbody { get; set; } = "";

        /// <summary>
        /// 肌肉量标准范围
        /// </summary>
        public string standardmuscleval { get; set; } = "";

        /// <summary>
        /// 蛋白量标准范围
        /// </summary>
        public string standardproteinval { get; set; } = "";

        /// <summary>
        /// 去脂体重标准范围
        /// </summary>
        public string standardlbm { get; set; } = "";

        /// <summary>
        /// 肥胖范围
        /// </summary>
        public string standardfatlevel { get; set; } = "";
    }

    /// <summary>
    /// 测量项等级
    /// </summary>
    public class MeasureLevel
    {
        /// <summary>
        /// 脂肪率标准
        /// </summary>
        public string fat_rLevel { get; set; } = "";

        /// <summary>
        /// 肌肉率标准
        /// </summary>
        public string muscleLevel { get; set; } = "";

        /// <summary>
        /// 水份标准
        /// </summary>
        public string waterLevel { get; set; } = "";

        /// <summary>
        /// 骨量标准
        /// </summary>
        public string boneLevel { get; set; } = "";

        /// <summary>
        /// 基础代谢标准
        /// </summary>
        public string kcalLevel { get; set; } = "";

        /// <summary>
        /// 脂肪重量标准
        /// </summary>
        public string fat_wLevel { get; set; } = "";

        /// <summary>
        /// 内脂等级
        /// </summary>
        public string visceralLevel { get; set; } = "";

        /// <summary>
        /// 蛋白率标准
        /// </summary>
        public string proteinLevel { get; set; } = "";

        /// <summary>
        /// 体龄标准
        /// </summary>
        public string bodyageLevel { get; set; } = "";

        /// <summary>
        /// bmi标准
        /// </summary>
        public string bmiLevel { get; set; } = "";

        /// <summary>
        /// 肌肉量标准,和肌肉率一致
        /// </summary>
        public string musulevalLevel { get; set; } = "";

        /// <summary>
        /// 蛋白量标准,和蛋白率一致
        /// </summary>
        public string proteinvalLevel { get; set; } = "";

        /// <summary>
        /// 皮下脂肪标准
        /// </summary>
        public string sfrLevel { get; set; } = "";

        /// <summary>
        /// 体型标准
        /// </summary>
        public string bodylevel { get; set; } = "";

        /// <summary>
        /// 肥胖等级标准
        /// </summary>
        public string fatLevel { get; set; } = "";

        /// <summary>
        /// 骨骼肌量标准
        /// </summary>
        public string skeletalmuscleLevel { get; set; } = "";
    }

    /// <summary>
    /// 测量结果范围值
    /// </summary>
    public class MeasureInfoItemValue
    {
        /// <summary>
        /// 最大值
        /// </summary>
        public decimal maxvalue { get; set; }

        /// <summary>
        /// 最小值
        /// </summary>
        public decimal minvalue { get; set; }

        /// <summary>
        /// 标准描述
        /// </summary>
        public string text { get; set; } = "";

        /// <summary>
        /// 颜色代码
        /// </summary>
        public string color { get; set; } = "";

        /// <summary>
        /// 所处的等级对应值
        /// </summary>
        public int Level { get; set; } = 0;
    }

    /// <summary>
    /// 测量信息项
    /// </summary>
    public class MeasureInfoItem
    {
        /// <summary>
        /// 测量项,bmi.fat_r.
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 结果值
        /// </summary>
        public decimal value { get; set; }

        /// <summary>
        /// 对比上一次的差值,正数增加,负数减少
        /// </summary>
        public decimal lastvalue { get; set; }

        /// <summary>
        /// 按次历史记录列表
        /// </summary>
        public List<MeasureHisItem> list { get; set; }

        /// <summary>
        /// 按天历史记录列表
        /// </summary>
        public List<MeasureHisItem> daylist { get; set; }

        /// <summary>
        /// 标准范围,从最低标准升序排列
        /// </summary>
        public List<MeasureInfoItemValue> slist { get; set; }

        /// <summary>
        /// 当前颜色代码
        /// </summary>
        public string Color { get; set; }
    }

    /// <summary>
    /// 历史结果
    /// </summary>
    public class MeasureHisItem
    {
        /// <summary>
        /// 值
        /// </summary>
        public string value { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        public string time { get; set; }
    }

    /// <summary>
    /// 用户测量详细测量结果
    /// </summary>
    public class UserMeasureInfo : UserMeasureModel
    {
        /// <summary>
        /// 历史记录值
        /// </summary>
        public List<MeasureInfoItem> list { get; set; }

        /// <summary>
        /// 是否为演示数据,true-是,false-否
        /// </summary>
        public bool IsTest { get; set; } = false;
    }

    /// <summary>
    /// 历史记录
    /// </summary>
    public class MeasureModels : UserMeasureModel
    {
        /// <summary>
        /// 测量记录ID
        /// </summary>
        public string resultid { get; set; }

        /// <summary>
        /// 时间戳
        /// </summary>
        public string timestamp { get; set; }
    }

    /// <summary>
    /// 手动添加的记录列表
    /// </summary>
    public class AddResultList
    {
        /// <summary>
        /// 记录ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 身高,CM
        /// </summary>
        public decimal Height { get; set; }

        /// <summary>
        /// 体重,KG
        /// </summary>
        public decimal Weight { get; set; }

        /// <summary>
        /// 测量时间
        /// </summary>
        public string ResultTime { get; set; }

        /// <summary>
        /// 添加时间
        /// </summary>
        public string CreateTime { get; set; }
    }

    /// <summary>
    /// 测量历史记录
    /// </summary>
    public class MeasureHisList
    {
        /// <summary>
        /// 测量时间
        /// </summary>
        public string createtime { get; set; }

        /// <summary>
        /// 身高
        /// </summary>
        public decimal Height { get; set; }

        /// <summary>
        /// 脂肪率
        /// </summary>
        public decimal fat_r { get; set; }

        /// <summary>
        /// 肌肉率
        /// </summary>
        public decimal muscle { get; set; }

        /// <summary>
        /// 水份
        /// </summary>
        public decimal water { get; set; }

        /// <summary>
        /// 骨重
        /// </summary>
        public decimal bone { get; set; }

        /// <summary>
        /// 基础代谢
        /// </summary>
        public decimal kcal { get; set; }

        /// <summary>
        /// 脂肪重量
        /// </summary>
        public decimal fat_w { get; set; }

        /// <summary>
        /// 内脂
        /// </summary>
        public decimal visceral { get; set; }

        /// <summary>
        /// 蛋白质
        /// </summary>
        public decimal protein { get; set; }

        /// <summary>
        /// 体龄
        /// </summary>
        public int bodyage { get; set; }

        /// <summary>
        /// bmi
        /// </summary>
        public decimal bmi { get; set; }

        /// <summary>
        /// 分数
        /// </summary>
        public decimal cmi { get; set; }

        /// <summary>
        /// 皮下脂肪
        /// </summary>
        public decimal sfr { get; set; }

        /// <summary>
        /// 肌肉量
        /// </summary>
        public decimal muscleval { get; set; }

        /// <summary>
        /// 蛋白量
        /// </summary>
        public decimal proteinval { get; set; }

        /// <summary>
        /// 去脂体重
        /// </summary>
        public decimal lbm { get; set; }

        /// <summary>
        /// 体型,参考体型枚举
        /// </summary>
        public string body { get; set; }

        /// <summary>
        /// 肥胖等级,参考等级枚举
        /// </summary>
        public string fatlevel { get; set; }

        /// <summary>
        /// 体重
        /// </summary>
        public decimal weight { get; set; }

        /// <summary>
        /// 年龄
        /// </summary>
        public string Age { get; set; }

        /// <summary>
        /// 月龄
        /// </summary>
        public int Month { get; set; }

        /// <summary>
        /// 记录ID
        /// </summary>
        public Guid Id { get; set; }
    }

    /// <summary>
    /// 用户测量记录
    /// </summary>
    public class UserResultDto : YB_nMeasureResult
    {
        /// <summary>
        /// 粉丝昵称
        /// </summary>
        public string NickName { get; set; }

        /// <summary>
        /// 设备ID
        /// </summary>
        public int EquId { get; set; }

        /// <summary>
        /// 设备序列号
        /// </summary>
        public string FacEcode { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string DevName { get; set; }

        /// <summary>
        /// 商户名称
        /// </summary>
        public string BusinessName { get; set; }

        /// <summary>
        /// 商户ID
        /// </summary>
        public string BusinessId { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserId { get; set; }
    }

    /// <summary>
    /// 测量数据
    /// </summary>
    public class MeasureDataDto
    {
        /// <summary>
        /// 昵称
        /// </summary>
        public string NickName { get; set; }

        /// <summary>
        /// 设备序列号
        /// </summary>
        public string FacEcode { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string DevName { get; set; }

        /// <summary>
        /// 商户名称
        /// </summary>
        public string BusinessName { get; set; }
    }
}