package models

import "time"

type WxXcxLoginReq struct {
	Code string `json:"code"`
}

type WxXcxLoginResp struct {
	Token  string `json:"token"`
	OpenId string `json:"openid"`
}

type SaveUserInfoReq struct {
	Phone string `json:"phone" COMMENT:"手机号码"`
	Email string `json:"email" COMMENT:"邮件"`
	//UnionId                 string `json:"union_id" COMMENT:"unionid"`
	NickName string `json:"nick_name" COMMENT:"昵称"`
	Avatar   string `json:"avatar" COMMENT:"头像"`
	//PrivacyProtocolVersions int    `json:"privacy_protocol_versions" COMMENT:"隐私政策版本"`

	RealName          string `json:"real_name" gorm:"type:varchar(64); COMMENT:'真实姓名'"`
	IdCard            string `json:"id_card" gorm:"type:varchar(64); COMMENT:'身份证号'"`
	InpatientRegPhone string `json:"inpatient_reg_phone" gorm:"type:varchar(32); COMMENT:'住院登记手机号'"`
}

type UserInfoResp struct {
	Id                      uint64 `json:"id" COMMENT:"Primary Key ID"`
	Phone                   string `json:"phone" COMMENT:"手机号码"`
	Email                   string `json:"email" COMMENT:"邮件"`
	OpenId                  string `json:"open_id" COMMENT:"OpenID"`
	UnionId                 string `json:"union_id" COMMENT:"unionid"`
	NickName                string `json:"nick_name" COMMENT:"昵称"`
	Avatar                  string `json:"avatar" COMMENT:"头像"`
	Status                  int    `json:"status" COMMENT:"状态（１：有效　0： 无效）"`
	Source                  string `json:"source" COMMENT:"用户来源"`
	PrivacyProtocolVersions int    `json:"privacy_protocol_versions" COMMENT:"隐私政策版本"`

	RealName          string `json:"real_name" gorm:"type:varchar(64); COMMENT:'真实姓名'"`
	IdCard            string `json:"id_card" gorm:"type:varchar(64); COMMENT:'身份证号'"`
	InpatientRegPhone string `json:"inpatient_reg_phone" gorm:"type:varchar(32); COMMENT:'住院登记手机号'"`

	Ctime time.Time `json:"ctime" COMMENT:"创建时间"`
	Mtime time.Time `json:"mtime" COMMENT:"更新时间 "`
}

type SaveHealthProfileReq struct {
	Gender              int       `json:"gender" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'性别（0：未知 1：男 2：女）'"`
	Height              int       `json:"height" gorm:"type:int(11); COMMENT:'身高'"`
	Weight              int       `json:"weight" gorm:"type:int(11); COMMENT:'体重'"`
	BloodType           string    `json:"blood_type" gorm:"type:varchar(32); COMMENT:'血型'"`
	Birthday            time.Time `json:"birthday" gorm:"type:datetime; COMMENT:'生日'"`
	IllnessState        string    `json:"illness_state" gorm:"type:varchar(255); COMMENT:'病情'"`
	RenalFunctionStatus int       `json:"renal_function_status" gorm:"type:int(11); COMMENT:'肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'"`
	Creatinine          int       `json:"creatinine" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'血肌酐'"`
	CreatinineUnit      string    `json:"creatinine_unit" gorm:"type:varchar(32); COMMENT:'肌酐单位(umol/L,mg/dl)'"`
	CreatineTime        time.Time `json:"creatine_time" gorm:"type:datetime; COMMENT:'肌酐检测时间'"`
	UrineProtein24hUnit string    `json:"urine_protein_24h_unit" gorm:"type:varchar(32); COMMENT:'24小时尿蛋白单位(g/24h,mg/24h)'"`
	UrineProtein24h     int       `json:"urine_protein_24h" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'24小时尿蛋白'"`
	UrineProtein24hTime time.Time `json:"urine_protein_24h_time" gorm:"type:datetime; COMMENT:'24小时尿蛋白检测时间'"`
	UrineProtein        int       `json:"urine_protein" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'尿蛋白'"`
	UrineProteinUnit    string    `json:"urine_protein_unit" gorm:"type:varchar(32); COMMENT:'尿蛋白单位(g,mg)'"`
	UrineProteinTime    time.Time `json:"urine_protein_time" gorm:"type:datetime; COMMENT:'尿蛋白检测时间'"`
}

type HealthProfileResp struct {
	Id uint64 `json:"id" gorm:"type:bigint(20) unsigned auto_increment; NOT NULL; primary_key; COMMENT:'Primary Key ID'"`
	//UserId              int64     `json:"user_id" gorm:"type:bigint(20); NOT NULL; COMMENT:'用户ID'"`
	//RealName            string    `json:"real_name" gorm:"type:varchar(64); COMMENT:'真实姓名'"`
	//IdCard              string    `json:"id_card" gorm:"type:varchar(64); COMMENT:'身份证号'"`
	//InpatientRegPhone   string    `json:"inpatient_reg_phone" gorm:"type:varchar(32); COMMENT:'住院登记手机号'"`
	Gender              int       `json:"gender" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'性别（0：未知 1：男 2：女）'"`
	Height              int       `json:"height" gorm:"type:int(11); COMMENT:'身高'"`
	Weight              int       `json:"weight" gorm:"type:int(11); COMMENT:'体重'"`
	BloodType           string    `json:"blood_type" gorm:"type:varchar(32); COMMENT:'血型'"`
	Birthday            time.Time `json:"birthday" gorm:"type:datetime; COMMENT:'生日'"`
	IllnessState        string    `json:"illness_state" gorm:"type:varchar(255); COMMENT:'病情'"`
	RenalFunctionStatus int       `json:"renal_function_status" gorm:"type:int(11); COMMENT:'肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'"`
	Creatinine          int       `json:"creatinine" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'血肌酐'"`
	CreatinineUnit      string    `json:"creatinine_unit" gorm:"type:varchar(32); COMMENT:'肌酐单位(umol/L,mg/dl)'"`
	CreatineTime        time.Time `json:"creatine_time" gorm:"type:datetime; COMMENT:'肌酐检测时间'"`
	UrineProtein24hUnit string    `json:"urine_protein_24h_unit" gorm:"type:varchar(32); COMMENT:'24小时尿蛋白单位(g/24h,mg/24h)'"`
	UrineProtein24h     int       `json:"urine_protein_24h" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'24小时尿蛋白'"`
	UrineProtein24hTime time.Time `json:"urine_protein_24h_time" gorm:"type:datetime; COMMENT:'24小时尿蛋白检测时间'"`
	UrineProtein        int       `json:"urine_protein" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'尿蛋白'"`
	UrineProteinUnit    string    `json:"urine_protein_unit" gorm:"type:varchar(32); COMMENT:'尿蛋白单位(g,mg)'"`
	UrineProteinTime    time.Time `json:"urine_protein_time" gorm:"type:datetime; COMMENT:'尿蛋白检测时间'"`
	Status              int       `json:"status" gorm:"type:int(11); DEFAULT:'1'; COMMENT:'状态(1:有效 0:无效 )'"`
	Ctime               time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'"`
	Mtime               time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '"`
}

type DicResp struct {
	Type  string `json:"type"`
	Name  string `json:"name"`
	Value int    `json:"value"`
}
