using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YBDevice.Entity;

namespace YBDevice.Application
{
    /// <summary>
    /// 用户测量记录
    /// </summary>
    public class MeasureUserListDto:MeasureDto
    {
        /// <summary>
        /// 客户ID
        /// </summary>
        public int Businesid { get; set; }
        /// <summary>
        /// 客户名称
        /// </summary>
        public string BusinessName { get; set; }
        /// <summary>
        /// 用户昵称
        /// </summary>
        public string headimg { get; set; }
        /// <summary>
        /// 用户昵称
        /// </summary>
        public string nickname { get; set; }
        /// <summary>
        /// 设备序列号
        /// </summary>
        public string facecode { get; set; }
        /// <summary>
        /// 设备名称
        /// </summary>
        public string devname { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public int equid { get; set; }
        /// <summary>
        /// 用户手机号
        /// </summary>
        public string phone { get; set; }
        /// <summary>
        /// 性别,1-男,2-女,0-未知
        /// </summary>
        public GenderType sex { get; set; }
        /// <summary>
        /// 记录ID
        /// </summary>
        public Guid id { get; set; }
        /// <summary>
        /// 注册用户id
        /// </summary>
        public int userid { get; set; }
        /// <summary>
        /// 测量时间
        /// </summary>
        public string createtime { get; set; }
        /// <summary>
        /// 家庭成员id
        /// </summary>
        public int familyid { get; set; }
        /// <summary>
        /// 月龄
        /// </summary>
        public int Month { get; set; }
        /// <summary>
        /// 设备类型
        /// </summary>
        public int DevType { get; set; }
        /// <summary>
        /// 粉丝ID
        /// </summary>
        public string fansid { get; set; }
        /// <summary>
        /// 体质类型
        /// </summary>
        public string BodyType { get; set; } = "-";
    }
    /// <summary>
    /// 测量项
    /// </summary>
    public class MeasureDto
    {
        /// <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 class MeasureUserWeightDto
    {
        /// <summary>
        /// 体重
        /// </summary>
        public decimal weight { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public string time { get; set; }
    }
    /// <summary>
    /// 用户测量记录
    /// </summary>
    public class MeasureUserDto
    {
        /// <summary>
        /// 第一次测量的体重
        /// </summary>
        public decimal FirstWeight { get; set; } = 0;
        /// <summary>
        /// 第一次测量的身高
        /// </summary>
        public decimal FirstHeight { get; set; } = 0;
        /// <summary>
        /// 最近一次测量的体重
        /// </summary>
        public decimal LastWeight { get; set; } = 0;
        /// <summary>
        /// 最近一次测量的身高
        /// </summary>
        public decimal LastHeight { get; set; } = 0;
        /// <summary>
        /// 最近一次测量时间
        /// </summary>
        public string LastResultTime { get; set; } = "";
        /// <summary>
        /// 第一次测量时间
        /// </summary>
        public string FirstResultTime { get; set; } = "";
        /// <summary>
        /// 第一次到最近的体重变化
        /// </summary>
        public decimal Weight { get; set; } = 0;

        /// <summary>
        /// 第一次到最近的身高变化
        /// </summary>
        public decimal Height { get; set; } = 0;
        /// <summary>
        /// 累计测量次数
        /// </summary>
        public int TotalResultCnt { get; set; } = 0;

        /// <summary>
        /// 今日测量次数
        /// </summary>
        public int TodayResultCnt { get; set; } = 0;
    }
    /// <summary>
    /// 家庭成员
    /// </summary>
    public class FamilyDto: MeasureUserDto
    {
        /// <summary>
        /// 家庭成员ID
        /// </summary>
        public  int id { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string HeadImg { get; set; }
        /// <summary>
        /// 类型,1-成人,2-儿童
        /// </summary>
        public FamilyType Type { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public GenderType Sex { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        public int Age { get; set; }
        /// <summary>
        /// 是否为自己,0-否,1-是
        /// </summary>
        public int IsSelf { get; set; }
    }

    /// <summary>
    /// 查询用户测量记录
    /// </summary>
    public class MeasureUserQueryDto
    {
        /// <summary>
        /// 开始时间
        /// </summary>
        public string starttime { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public string endtime { get; set; }
        /// <summary>
        /// 测量记录ID
        /// </summary>
        public int id { get; set; }
    }
    /// <summary>
    /// 八电极测量项
    /// </summary>
    public class UserMeasureDto : MeasureLevelDto
    {
        /// <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>
        /// 骨重,kg
        /// </summary>
        public decimal bone { get; set; } = 0;

        /// <summary>
        /// 基础代谢,kcal/day
        /// </summary>
        public decimal kcal { get; set; } = 0;
        /// <summary>
        /// 躯干肌肉率,%
        /// </summary>
        public decimal muscleratetrunk { get; set; } = 0;

        /// <summary>
        /// 左脚肌肉率,%
        /// </summary>
        public decimal musclerateleftleg { get; set; } = 0;

        /// <summary>
        /// 右脚肌肉率,%
        /// </summary>
        public decimal muscleraterightleg { get; set; } = 0;
        /// <summary>
        /// 左手肌肉率,%
        /// </summary>
        public decimal musclerateleftarm { get; set; } = 0;
        /// <summary>
        /// 右手肌肉率,%
        /// </summary>
        public decimal muscleraterightarm { get; set; } = 0;

        /// <summary>
        /// 躯干脂肪率,%
        /// </summary>
        public decimal bodyfatraterunk { get; set; } = 0;
        /// <summary>
        /// 左脚脂肪率,%
        /// </summary>
        public decimal bodyfatrateleftleg { get; set; } = 0;
        /// <summary>
        /// 右脚脂肪率,%
        /// </summary>
        public decimal bodyfatraterightleg { get; set; } = 0;
        /// <summary>
        /// 左手脂肪率,%
        /// </summary>
        public decimal bodyfatrateleftarm { get; set; } = 0;
        /// <summary>
        /// 右手脂肪率,%
        /// </summary>
        public decimal bodyfatraterightarm { get; set; } = 0;
        /// <summary>
        /// 躯干肌肉量,kg
        /// </summary>
        public decimal musclekgtrunk { get; set; } = 0;
        /// <summary>
        /// 左脚肌肉量,kg
        /// </summary>
        public decimal musclekgleftleg { get; set; } = 0;
        /// <summary>
        /// 右脚肌肉量,kg
        /// </summary>
        public decimal musclekgrightleg { get; set; } = 0;
        /// <summary>
        /// 左手肌肉量,kg
        /// </summary>
        public decimal musclekgleftarm { get; set; } = 0;
        /// <summary>
        /// 右手肌肉量,kg
        /// </summary>
        public decimal musclekgrightarm { get; set; } = 0;
        /// <summary>
        /// 躯干脂肪量,kg
        /// </summary>
        public decimal bodyfatkgtrunk { get; set; } = 0;
        /// <summary>
        /// 左脚脂肪量,kg
        /// </summary>
        public decimal bodyfatkgleftleg { get; set; } = 0;
        /// <summary>
        /// 右脚脂肪量,kg
        /// </summary>
        public decimal bodyfatkgrightleg { get; set; } = 0;
        /// <summary>
        /// 左手脂肪量,kg
        /// </summary>
        public decimal bodyfatkgleftarm { get; set; } = 0;
        /// <summary>
        /// 右手脂肪量,kg
        /// </summary>
        public decimal bodyfatkgrightarm { get; set; } = 0;
        /// <summary>
        /// 脂肪重量,kg
        /// </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>
        /// 蛋白量,kg
        /// </summary>
        public decimal proteinval { get; set; } = 0;
        /// <summary>
        /// 骨骼肌量,kg
        /// </summary>
        public decimal SkeletalMuscle { get; set; } = 0;

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

        /// <summary>
        /// BMI,kg/m2
        /// </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 muscleval { get; set; } = 0;


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

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

        /// <summary>
        /// 体重,kg
        /// </summary>
        public decimal weight { get; set; } = 0;
        /// <summary>
        /// 理想体重,kg
        /// </summary>
        public decimal idealweight { get; set; } = 0;
    }
    /// <summary>
    /// 用户测量详情
    /// </summary>
    public class UserMeasureDetailDto: UserMeasureDto
    {
        /// <summary>
        /// 类型,1-单电阻,2-八电极
        /// </summary>
        public int type { get; set; }
        /// <summary>
        /// 用户昵称
        /// </summary>
        public string NickName { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string HeadImg { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone { get; set; }
        /// <summary>
        /// 测量时间
        /// </summary>
        public string Time { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public GenderType Sex { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        public int Age { get; set; }
        /// <summary>
        /// 身高
        /// </summary>
        public decimal Height { get; set; }
        /// <summary>
        /// 范围列表
        /// </summary>
        public MeasureValueDto values { get; set; }
    }
    /// <summary>
    /// 测量项标准范围
    /// </summary>
    public class MeasureValueDto
    {
        /// <summary>
        /// bmi范围标准
        /// </summary>
       public List<MeasureInfoItemValue> bmi_value { get; set; }

        /// <summary>
        /// 脂肪率/体脂率范围标准
        /// </summary>
        public List<MeasureInfoItemValue> fa_r_value { get; set; }

        /// <summary>
        /// 脂肪重量标准范围
        /// </summary>
        public List<MeasureInfoItemValue> fat_w_value { get; set; }

        /// <summary>
        /// 肌肉率范围
        /// </summary>
        public List<MeasureInfoItemValue> muscle_value { get; set; }

        /// <summary>
        /// 肌肉重量标准范围
        /// </summary>
        public List<MeasureInfoItemValue> muscleval_value { get; set; }

        /// <summary>
        /// 水份范围
        /// </summary>
        public List<MeasureInfoItemValue> water_value { get; set; }

        /// <summary>
        /// 骨量范围
        /// </summary>
        public List<MeasureInfoItemValue> bone_value { get; set; }

        /// <summary>
        /// 基础代谢范围
        /// </summary>
        public List<MeasureInfoItemValue> kcal_value { get; set; }

        /// <summary>
        /// 内脂范围
        /// </summary>
        public List<MeasureInfoItemValue> visceral_value { get; set; }

        /// <summary>
        /// 蛋白质范围
        /// </summary>
        public List<MeasureInfoItemValue> protein_value { get; set; }

        /// <summary>
        /// 蛋白量标准范围
        /// </summary>
        public List<MeasureInfoItemValue> proteinval_value { get; set; }

        /// <summary>
        /// 皮下脂肪范围
        /// </summary>
        public List<MeasureInfoItemValue> sfr_value { get; set; }
        /// <summary>
        /// 皮下脂肪量范围
        /// </summary>
        public List<MeasureInfoItemValue> sfrval_value { get; set; }

        /// <summary>
        /// 骨骼肌量范围
        /// </summary>
        public List<MeasureInfoItemValue> skeletalmusclekg_value { get; set; }
    }

    /// <summary>
    /// 测量项等级
    /// </summary>
    public class MeasureLevelDto
    {
        /// <summary>
        /// 骨骼肌量标准
        /// </summary>
        public string SkeletalMuscleLevel { get; set; } = "";
        /// <summary>
        /// 肥胖等级标准
        /// </summary>
        public string fatLevel { get; set; } = "";
        /// <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 class BodyReponseInfo
    {
        /// <summary>
        /// 状态,1000测量成功,其他均是失败
        /// </summary>
        public int code { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public string status { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        public string message { get; set; }
    }
    /// <summary>
    /// 八电极算法接口返回数据
    /// </summary>
    public class BodyReponseInfo<T> : BodyReponseInfo
    {
        /// <summary>
        /// 数据
        /// </summary>
        public List<T> data { get; set; }
    }

    public class BodyResponseData
    {
        /// <summary>
        /// 参数名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 值
        /// </summary>
        public object value { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public BodyResponseDataDesc description { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        public string unit { get; set; }
        /// <summary>
        /// 标准
        /// </summary>
        public BodyResponseDataLevel level { get; set; }
    }
    /// <summary>
    /// 测量项标准
    /// </summary>
    public class BodyResponseDataLevel
    {
        /// <summary>
        /// 标准值
        /// </summary>
        public string value { get; set; }
        /// <summary>
        /// 范围
        /// </summary>
        public List<string> stand { get; set; }
    }
    /// <summary>
    /// 参数描述
    /// </summary>
    public class BodyResponseDataDesc
    {
        /// <summary>
        /// 描述定义
        /// </summary>
        public string definition { get; set; }
        /// <summary>
        /// 提示
        /// </summary>
        public string tips { get; set; }
    }
}
