package models import "time" type Time time.Time const ( timeFormart = "2006-01-02 15:04:05" ) func (t *Time) UnmarshalJSON(data []byte) (err error) { now, err := time.ParseInLocation(`"`+timeFormart+`"`, string(data), time.Local) *t = Time(now) return } func (t *Time) Parse(date string) (now time.Time, err error) { now, err = time.ParseInLocation(timeFormart, date, time.Local) *t = Time(now) return } func (t Time) MarshalJSON() ([]byte, error) { b := make([]byte, 0, len(timeFormart)+2) b = append(b, '"') b = time.Time(t).AppendFormat(b, timeFormart) b = append(b, '"') return b, nil } func (t Time) String() string { return time.Time(t).Format(timeFormart) } type WxXcxLoginReq struct { Code string `json:"code"` } type WxXcxLoginResp struct { Token string `json:"token"` OpenId string `json:"openid"` PatientId int64 ` json:"patient_id"` UserOrgId int64 ` json:"user_org_id"` } type SaveUserInfoReq struct { Phone string `json:"phone" description:"手机号码"` Email string `json:"email" description:"邮件"` //UnionId string `json:"union_id" description:"unionid"` NickName string `json:"nick_name" description:"昵称"` Avatar string `json:"avatar" description:"头像"` //PrivacyProtocolVersions int `json:"privacy_protocol_versions" description:"隐私政策版本"` RealName string `json:"real_name" description:"真实姓名"` IdCard string `json:"id_card" description:"身份证号"` InpatientRegPhone string `json:"inpatient_reg_phone" description:"住院登记手机号"` } type UserInfoResp struct { Id uint64 `json:"id" description:"Primary Key ID"` Phone string `json:"phone" description:"手机号码"` Email string `json:"email" description:"邮件"` OpenId string `json:"open_id" description:"OpenID"` UnionId string `json:"union_id" description:"unionid"` NickName string `json:"nick_name" description:"昵称"` Avatar string `json:"avatar" description:"头像"` Status int `json:"status" description:"状态(1:有效0:无效)"` Source string `json:"source" description:"用户来源"` PrivacyProtocolVersions int `json:"privacy_protocol_versions" description:"隐私政策版本"` RealName string `json:"real_name" description:"真实姓名"` IdCard string `json:"id_card" description:"身份证号"` InpatientRegPhone string `json:"inpatient_reg_phone" description:"住院登记手机号"` PatientId int64 ` json:"patient_id"` UserOrgId int64 ` json:"user_org_id"` DialysisNo string `gorm:"column:dialysis_no" json:"dialysis_no" description:" 透析号"` HealthCareNo string `gorm:"column:health_care_no" json:"health_care_no" description:" 医保号"` Ctime Time `json:"ctime" description:"创建时间"` Mtime Time `json:"mtime" description:"更新时间 "` } type SaveHealthProfileReq struct { Gender int `json:"gender" description:"性别(0:未知 1:男 2:女)"` Height int `json:"height" description:"身高"` Weight int `json:"weight" description:"体重"` BloodType string `json:"blood_type" description:"血型"` Birthday string `json:"birthday" description:"生日 yyyy-MM-dd HH:mm:ss"` IllnessState string `json:"illness_state" description:"病情"` RenalFunctionStatus int `json:"renal_function_status" description:"肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)"` Creatinine int `json:"creatinine" description:"血肌酐"` CreatinineUnit string `json:"creatinine_unit" description:"肌酐单位(umol/L,mg/dl)"` CreatineTime string `json:"creatine_time" description:"肌酐检测时间 yyyy-MM-dd HH:mm:ss"` UrineProtein24hUnit string `json:"urine_protein_24h_unit" description:"24小时尿蛋白单位(g/24h,mg/24h)"` UrineProtein24h int `json:"urine_protein_24h" description:"24小时尿蛋白"` UrineProtein24hTime string `json:"urine_protein_24h_time" description:"24小时尿蛋白检测时间 yyyy-MM-dd HH:mm:ss"` UrineProtein int `json:"urine_protein" description:"尿蛋白"` UrineProteinUnit string `json:"urine_protein_unit" description:"尿蛋白单位(g,mg)"` UrineProteinTime string `json:"urine_protein_time" description:"尿蛋白检测时间 yyyy-MM-dd HH:mm:ss"` } type HealthProfileResp struct { Id uint64 `json:"id" description:"Primary Key ID"` //UserId int64 `json:"user_id" description:"用户ID"` //RealName string `json:"real_name" description:"真实姓名"` //IdCard string `json:"id_card" description:"身份证号"` //InpatientRegPhone string `json:"inpatient_reg_phone" description:"住院登记手机号"` Gender int `json:"gender" description:"性别(0:未知 1:男 2:女)"` Height int `json:"height" description:"身高"` Weight int `json:"weight" description:"体重"` BloodType string `json:"blood_type" description:"血型"` Birthday Time `json:"birthday" description:"生日"` IllnessState string `json:"illness_state" description:"病情"` RenalFunctionStatus int `json:"renal_function_status" description:"肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)"` Creatinine int `json:"creatinine" description:"血肌酐"` CreatinineUnit string `json:"creatinine_unit" description:"肌酐单位(umol/L,mg/dl)"` CreatineTime Time `json:"creatine_time" description:"肌酐检测时间"` UrineProtein24hUnit string `json:"urine_protein_24h_unit" description:"24小时尿蛋白单位(g/24h,mg/24h)"` UrineProtein24h int `json:"urine_protein_24h" description:"24小时尿蛋白"` UrineProtein24hTime Time `json:"urine_protein_24h_time" description:"24小时尿蛋白检测时间"` UrineProtein int `json:"urine_protein" description:"尿蛋白"` UrineProteinUnit string `json:"urine_protein_unit" description:"尿蛋白单位(g,mg)"` UrineProteinTime Time `json:"urine_protein_time" description:"尿蛋白检测时间"` Status int `json:"status" description:"状态(1:有效 0:无效 )"` Ctime Time `json:"ctime" description:"创建时间"` Mtime Time `json:"mtime" description:"更新时间 "` } type DicResp struct { Type string `json:"type"` Name string `json:"name" description:"字典名称"` Value int `json:"value" description:"字典值"` ValueStr string `json:"value_str" description:"字典字符串值"` } type OpenEmqMsgReqVO struct { UserName string `json:"username" description:"用户名"` Topic string `json:"topic" description:"主题"` PeerHost string `json:"peerhost" description:"主机"` Payload string `json:"payload" description:"负载"` Id string `json:"id"` ProductKey string `json:"productKey" description:"产品key"` DeviceName string `json:"deviceName" description:"设备名称"` Acc int `json:"acc"` Type int `json:"type"` Count int `json:"count"` DataType int `json:"datatype"` VerifyCode string `json:"verifycode"` Data string `json:"data"` Origin string `json:"origin"` Len int `json:"len"` } type OpenEmqPayloadReqVO struct { ProductKey string `json:"productKey"` // 产品密钥 DeviceName string `json:"deviceName"` // 设备名称 Acc int `json:"acc"` // 准确度 Type int `json:"type"` // 类型 Count int `json:"count"` // 计数 Datatype int `json:"datatype"` // 数据类型 Verifycode int `json:"verifycode"` // 验证码 Data string `json:"data"` // 数据 Origin string `json:"origin"` // 来源 Len int `json:"len"` // 长度 } type CheckItemScopeVO struct { Index int `json:"index"` Type int `json:"type"` Value string `json:"value"` Num string `json:"num"` } type AppCheckRecordVO struct { // AlertCount is the number of alerts. AlertCount int `json:"alert_count" description:"异常数量"` // NormalCount is the number of normal items. NormalCount int `json:"normal_count" description:"正常数量"` // Describe is the description of the record. Describe string `json:"describe" description:"描述"` // CheckDate is the date when the check was performed. CheckDate Time `json:"check_date" description:"检测日期"` // CheckRecordID is the ID of the check record. CheckRecordId int64 `json:"check_record_id" description:"检测记录id"` // UserID is the user ID, defaulting to the user's own ID. UserId uint64 `json:"user_id" description:"绑定用户id 默认自己"` // AlertGrade is the risk level: 1 for low, 2 for medium, 3 for high. //AlertGrade int `json:"alert_grade" description:"风险等级 1 低 2 中 3 高"` // View indicates whether the record has been viewed. View int `json:"view" description:"是否查看 1 已查看 0 未查看"` // Bind indicates whether the user is bound. Bind int `json:"bind" description:"0 未绑定用户 1 绑定"` // AlertItems is a list of alert items. AlertItems []string `json:"alert_items" description:"异常项"` } // AppCheckRecordItemDetailsVO 结构体表示检测记录项的详细信息 type AppCheckRecordItemDetailsVO struct { NameCn string `json:"name_cn" description:"中文名字"` NameEn string `json:"name_en" description:"英文名字"` Unit string `json:"unit" description:"单位"` Value string `json:"value" description:"检测值"` ValueIndex string `json:"value_index" description:"检测值索引"` CheckItemScopes []CheckItemScopeVO `json:"check_item_scopes" description:"检测范围"` ReferenceValue string `json:"reference_value" description:"参考值"` Describe string `json:"describe" description:"描述"` Alert bool `json:"alert" description:"true:异常,false:正常"` ID int `json:"id" description:"id"` } // AppCheckRecordItemVO 结构体表示检测记录项 type AppCheckRecordItemVO struct { AlertCount int `json:"alert_count" description:"异常数量"` NormalCount int `json:"normal_count" description:"正常数量"` Describe string `json:"describe" description:"描述"` CheckDate Time `json:"check_date" description:"检测日期"` CheckRecordID int64 `json:"check_record_id" description:"检测记录id"` UserID int64 `json:"user_id" description:"绑定用户id 默认自己"` AlertGrade int `json:"alert_grade" description:"风险等级 1 低 2 中 3 高"` Bind bool `json:"bind" description:"false 未绑定用户 true 绑定"` Items []AppCheckRecordItemDetailsVO `json:"items" description:"检测详情"` Status int `json:"status" description:"设备绑定状态(扫码查看结果时返回):1 未绑定 2设备为他人绑定 3设备为自己绑定"` } type AppCheckRecordItemReportVO struct { Unit string `json:"unit" description:"单位"` Value string `json:"value" description:"检测值"` CheckValueIndex int `json:"check_value_index" description:"检测值下标"` Describe string `json:"describe" description:"描述"` ID int `json:"id" description:"id"` Date Time `json:"date" description:"检测时间"` }