Browse Source

add device

Rick.Lan 2 months ago
parent
commit
35f1ea1a0f

+ 1 - 0
.gitignore View File

1
 sws_xcx.exe
1
 sws_xcx.exe
2
 sws_xcx.exe~
2
 sws_xcx.exe~
3
+sws_xcx

+ 4 - 4
conf/app.conf View File

15
 qiniu_domain = https://images.shengws.com/
15
 qiniu_domain = https://images.shengws.com/
16
 qiniu_bucket = syhclub-storage
16
 qiniu_bucket = syhclub-storage
17
 
17
 
18
-#appid = "wxcdf53b48b7df107e"
18
+appid = "wxcdf53b48b7df107e"
19
 key="Yz1HgsFX3yJvWPJSEdwJDA=="
19
 key="Yz1HgsFX3yJvWPJSEdwJDA=="
20
-#appsecret="94e944a69ad1d43ac447f5a8769ab801"
20
+appsecret="94e944a69ad1d43ac447f5a8769ab801"
21
 
21
 
22
 [test]
22
 [test]
23
 redishost = kuyi6666.redis.rds.aliyuncs.com
23
 redishost = kuyi6666.redis.rds.aliyuncs.com
38
 writemysqlname = sws_xcx
38
 writemysqlname = sws_xcx
39
 
39
 
40
 
40
 
41
-appid = "wx25576346fbca6905"
42
-appsecret="f6d53ccb4a529dc4d3bd543a7634b6bd"
41
+#appid = "wx25576346fbca6905"
42
+#appsecret="f6d53ccb4a529dc4d3bd543a7634b6bd"

+ 7 - 3
controllers/api_base_controller.go View File

38
 
38
 
39
 	beego.Router("/xcx/api/sysdic/getrenalstatus", &SysDicApiController{}, "Get:GetRenalStatus")
39
 	beego.Router("/xcx/api/sysdic/getrenalstatus", &SysDicApiController{}, "Get:GetRenalStatus")
40
 
40
 
41
+	beego.Router("/xcx/api/sysdic/getcheckitems", &SysDicApiController{}, "Get:GetCheckItems")
42
+
43
+	beego.Router("/xcx/api/sysdic/getdevicetypes", &SysDicApiController{}, "Get:GetDeviceTypes")
44
+
41
 }
45
 }
42
 
46
 
43
 type BaseApiController struct {
47
 type BaseApiController struct {
172
 	uJson, _ := json.Marshal(u)
176
 	uJson, _ := json.Marshal(u)
173
 	redisCli := service.RedisClient()
177
 	redisCli := service.RedisClient()
174
 	defer redisCli.Close()
178
 	defer redisCli.Close()
175
-	redisCli.Set(fmt.Sprintf("session:%v", key), uJson, time.Hour*time.Duration(expire))
179
+	redisCli.Set(fmt.Sprintf("session:%v", key), uJson, time.Second*time.Duration(expire))
176
 	// 创建一个我们自己的声明
180
 	// 创建一个我们自己的声明
177
 	claims := CustomClaims{
181
 	claims := CustomClaims{
178
 		UserID: key,
182
 		UserID: key,
179
 		StandardClaims: jwt.StandardClaims{
183
 		StandardClaims: jwt.StandardClaims{
180
-			ExpiresAt: time.Now().Add(time.Hour * time.Duration(expire)).Unix(), // Token有效期(默认为7200秒)
181
-			Issuer:    "sws_xcx",                                                // 签发者
184
+			ExpiresAt: time.Now().Add(time.Second * time.Duration(expire)).Unix(), // Token有效期(默认为7200秒)
185
+			Issuer:    "sws_xcx",                                                  // 签发者
182
 		},
186
 		},
183
 	}
187
 	}
184
 
188
 

+ 5 - 0
controllers/check_record_api_controller.go View File

1
+package controllers
2
+
3
+type CheckRecordApiController struct {
4
+	BaseApiAuthController
5
+}

+ 76 - 1
controllers/device_api_controllor.go View File

1
 package controllers
1
 package controllers
2
 
2
 
3
+import "sws_xcx/service"
4
+
3
 type DeviceApiController struct {
5
 type DeviceApiController struct {
4
-	BaseApiController
6
+	BaseApiAuthController
7
+}
8
+
9
+// @Title GetMyDevices
10
+// @Description 获取绑定的设备列表
11
+// @Success 200 {array} models.Device success
12
+// @Failure 500 error
13
+// @Security token
14
+// @router /getmydevices [get]
15
+func (c *DeviceApiController) GetMyDevices() {
16
+
17
+	devices, err := service.NewDeviceService().GetMyDevices(c.CurrentUser.Id)
18
+	if err != nil {
19
+		c.ServeDynamicFailJsonSend(err.Error())
20
+
21
+	}
22
+	c.ServeSuccessJSON(devices)
23
+
24
+}
25
+
26
+// @Title GetDeviceDetail
27
+// @Description 根据设备ID获取设备详细信息
28
+// @Param   id path int true "设备ID"
29
+// @Success 200 {object} models.Device success
30
+// @Failure 500 error
31
+// @Security token
32
+// @router /getdevicedetail [get]
33
+func (c *DeviceApiController) GetDeviceDetail() {
34
+
35
+	id, err := c.GetInt("id")
36
+	if err != nil {
37
+		c.ServeDynamicFailJsonSend(err.Error())
38
+	}
39
+	device, err := service.NewDeviceService().GetDeviceInfo(id)
40
+	if err != nil {
41
+		c.ServeDynamicFailJsonSend(err.Error())
42
+	}
43
+	c.ServeSuccessJSON(device)
44
+}
45
+
46
+// @Title BindDevice
47
+// @Description 绑定设备
48
+// @Param   deviceid path int true "设备ID"
49
+// @Success 200  success
50
+// @Failure 500 error
51
+// @Security token
52
+// @router /binddevice [post]
53
+func (c *DeviceApiController) BindDevice() {
54
+	id, err := c.GetInt("deviceid")
55
+	if err != nil {
56
+		c.ServeDynamicFailJsonSend(err.Error())
57
+	}
58
+	if err := service.NewDeviceService().BindDevice(c.CurrentUser.Id, uint64(id)); err != nil {
59
+		c.ServeDynamicFailJsonSend(err.Error())
60
+	}
61
+	c.ServeSuccessJSON(new(interface{}))
62
+}
63
+
64
+// @Title UnBindDevice
65
+// @Description 解绑设备
66
+// @Param   deviceid path int true "设备ID"
67
+// @Success 200  success
68
+// @Failure 500 error
69
+// @Security token
70
+// @router /unbinddevice [post]
71
+func (c *DeviceApiController) UnbindDevice() {
72
+	id, err := c.GetInt("deviceid")
73
+	if err != nil {
74
+		c.ServeDynamicFailJsonSend(err.Error())
75
+	}
76
+	if err := service.NewDeviceService().UnbindDevice(c.CurrentUser.Id, uint64(id)); err != nil {
77
+		c.ServeDynamicFailJsonSend(err.Error())
78
+	}
79
+	c.ServeSuccessJSON(new(interface{}))
5
 }
80
 }

+ 33 - 2
controllers/sysdic_api_controller.go View File

8
 
8
 
9
 // @Title GetIllness
9
 // @Title GetIllness
10
 // @Description 获取病情字典
10
 // @Description 获取病情字典
11
-// @Success 200 {object} models.type DicResp success
11
+// @Success 200 {array} models.DicResp success
12
 // @Failure 500 error
12
 // @Failure 500 error
13
 // @router /getillness [get]
13
 // @router /getillness [get]
14
 func (c *SysDicApiController) GetIllness() {
14
 func (c *SysDicApiController) GetIllness() {
24
 
24
 
25
 // @Title GetRenalStatus
25
 // @Title GetRenalStatus
26
 // @Description 获取肾功能情况列表
26
 // @Description 获取肾功能情况列表
27
-// @Success 200 {object} models.type DicResp success
27
+// @Success 200 {array} models.DicResp success
28
 // @Failure 500 error
28
 // @Failure 500 error
29
 // @router /getrenalstatus [get]
29
 // @router /getrenalstatus [get]
30
 func (c *SysDicApiController) GetRenalStatus() {
30
 func (c *SysDicApiController) GetRenalStatus() {
37
 
37
 
38
 	c.ServeSuccessJSON(s.Transform(dics))
38
 	c.ServeSuccessJSON(s.Transform(dics))
39
 }
39
 }
40
+
41
+// @Title GetDeviceTypes
42
+// @Description 获取设备类型列表
43
+// @Success 200 {array} models.DicResp success
44
+// @Failure 500 error
45
+// @router /getdevicetypes [get]
46
+func (c *SysDicApiController) GetDeviceTypes() {
47
+	s := service.NewSysDicService()
48
+	dics, err := s.GetDicsByType("DEVICE_TYPE")
49
+	if err != nil {
50
+		c.ServeDynamicFailJsonSend(err.Error())
51
+		return
52
+	}
53
+
54
+	c.ServeSuccessJSON(s.Transform(dics))
55
+}
56
+
57
+// @Title GetCheckItems
58
+// @Description 获取检测项目列表
59
+// @Success 200 {array} models.CheckItem success
60
+// @Failure 500 error
61
+// @router /getcheckitems [get]
62
+func (c *SysDicApiController) GetCheckItems() {
63
+	s := service.NewCheckItemService()
64
+	dics, err := s.GetCheckItems("cn")
65
+	if err != nil {
66
+		c.ServeDynamicFailJsonSend(err.Error())
67
+		return
68
+	}
69
+	c.ServeSuccessJSON(dics)
70
+}

+ 102 - 102
models/dbmodels.go View File

4
 
4
 
5
 //检测项目
5
 //检测项目
6
 type CheckItem struct {
6
 type CheckItem struct {
7
-	Id              int       `json:"id" gorm:"type:int(11) auto_increment; NOT NULL; primary_key; COMMENT:'检测项目ID'"`
8
-	CheckItemNumber int       `json:"check_item_number" gorm:"type:int(11); COMMENT:'排序'"`
9
-	Language        string    `json:"language" gorm:"type:varchar(255); COMMENT:'cn: 中文 en 英文'"`
10
-	NameEn          string    `json:"name_en" gorm:"type:varchar(255); COMMENT:'检测项目英文名'"`
11
-	NameCn          string    `json:"name_cn" gorm:"type:varchar(255); COMMENT:'检测项目中文名'"`
12
-	DeviceType      string    `json:"device_type" gorm:"type:varchar(11); COMMENT:'设备类型'"`
13
-	CheckType       string    `json:"check_type" gorm:"type:varchar(255); COMMENT:'检测类型(试纸类型)'"`
14
-	ReferenceValue  string    `json:"reference_value" gorm:"type:varchar(255); COMMENT:' 参考值'"`
15
-	ScopeList       string    `json:"scope_list" gorm:"type:text; COMMENT:'范围value 值,type =1为正常、2及以上为异 常'"`
16
-	Text            string    `json:"text" gorm:"type:varchar(255); COMMENT:'文本'"`
17
-	Details         string    `json:"details" gorm:"type:text; COMMENT:'描述'"`
18
-	Unit            string    `json:"unit" gorm:"type:varchar(255); COMMENT:'单位'"`
19
-	Remark          string    `json:"remark" gorm:"type:varchar(255); COMMENT:'备注'"`
20
-	Ctime           time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'"`
21
-	Mtime           time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '"`
22
-	DeleteFlag      int       `json:"delete_flag" gorm:"type:int(11); COMMENT:'删除标志'"`
7
+	Id              int       `json:"id" gorm:"type:int(11) auto_increment; NOT NULL; primary_key; COMMENT:'检测项目ID'" description:"检测项目ID"`
8
+	CheckItemNumber int       `json:"check_item_number" gorm:"type:int(11); COMMENT:'排序'" description:"排序"`
9
+	Language        string    `json:"language" gorm:"type:varchar(255); COMMENT:'cn: 中文 en 英文'" description:"cn: 中文 en 英文"`
10
+	NameEn          string    `json:"name_en" gorm:"type:varchar(255); COMMENT:'检测项目英文名'" description:"检测项目英文名"`
11
+	NameCn          string    `json:"name_cn" gorm:"type:varchar(255); COMMENT:'检测项目中文名'" description:"检测项目中文名"`
12
+	DeviceType      string    `json:"device_type" gorm:"type:varchar(11); COMMENT:'设备类型'" description:"设备类型"`
13
+	CheckType       string    `json:"check_type" gorm:"type:varchar(255); COMMENT:'检测类型(试纸类型)'" description:"检测类型(试纸类型)"`
14
+	ReferenceValue  string    `json:"reference_value" gorm:"type:varchar(255); COMMENT:' 参考值'" description:" 参考值"`
15
+	ScopeList       string    `json:"scope_list" gorm:"type:text; COMMENT:'范围value 值,type =1为正常、2及以上为异 常'" description:"范围value 值,type =1为正常、2及以上为异 常"`
16
+	Text            string    `json:"text" gorm:"type:varchar(255); COMMENT:'文本'" description:"文本"`
17
+	Details         string    `json:"details" gorm:"type:text; COMMENT:'描述'" description:"描述"`
18
+	Unit            string    `json:"unit" gorm:"type:varchar(255); COMMENT:'单位'" description:"单位"`
19
+	Remark          string    `json:"remark" gorm:"type:varchar(255); COMMENT:'备注'" description:"备注"`
20
+	Ctime           time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'" description:"创建时间"`
21
+	Mtime           time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '" description:"更新时间 "`
22
+	DeleteFlag      int       `json:"delete_flag" gorm:"type:int(11); COMMENT:'删除标志'" description:"删除标志"`
23
 }
23
 }
24
 
24
 
25
 func (CheckItem) TableName() string {
25
 func (CheckItem) TableName() string {
28
 
28
 
29
 //检测记录
29
 //检测记录
30
 type CheckRecord struct {
30
 type CheckRecord struct {
31
-	Id                  int64     `json:"id" gorm:"type:bigint(20); NOT NULL; primary_key; COMMENT:'检测记录ID'"`
32
-	CheckType           string    `json:"check_type" gorm:"type:varchar(255); COMMENT:'检测类型(试纸类型)'"`
33
-	PutSources          string    `json:"put_sources" gorm:"type:varchar(255); COMMENT:'上传数据来源'"`
34
-	DeviceId            uint64    `json:"device_id" gorm:"type:bigint(20) unsigned; COMMENT:'设备ID'"`
35
-	DeviceStatus        int       `json:"device_status" gorm:"type:int(2); COMMENT:'设备状态'"`
36
-	MessageId           string    `json:"message_id" gorm:"type:varchar(255); COMMENT:'设备消息id'"`
37
-	UserId              uint64    `json:"user_id" gorm:"type:bigint(20) unsigned; DEFAULT:'0'; COMMENT:'用户ID'"`
38
-	UserHealthProfileId int64     `json:"user_health_profile_id" gorm:"type:bigint(20); DEFAULT:'0'; COMMENT:'健康档案ID'"`
39
-	View                int       `json:"view" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'查看:1(已查看) 0(未查看)'"`
40
-	AlertItemIds        string    `json:"alert_item_ids" gorm:"type:varchar(255); COMMENT:'异常项目id (1,2,3)'"`
41
-	Acc                 int       `json:"acc" gorm:"type:int(10); COMMENT:'设备检测次数'"`
42
-	Ctime               time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间 '"`
43
-	Mtime               time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间'"`
44
-	DeleteFlag          int       `json:"delete_flag" gorm:"type:int(1); DEFAULT:'0'; COMMENT:'删除标志'"`
31
+	Id                  int64     `json:"id" gorm:"type:bigint(20); NOT NULL; primary_key; COMMENT:'检测记录ID'" description:"检测记录ID"`
32
+	CheckType           string    `json:"check_type" gorm:"type:varchar(255); COMMENT:'检测类型(试纸类型)'" description:"检测类型(试纸类型)"`
33
+	PutSources          string    `json:"put_sources" gorm:"type:varchar(255); COMMENT:'上传数据来源'" description:"上传数据来源"`
34
+	DeviceId            uint64    `json:"device_id" gorm:"type:bigint(20) unsigned; COMMENT:'设备ID'" description:"设备ID"`
35
+	DeviceStatus        int       `json:"device_status" gorm:"type:int(2); COMMENT:'设备状态'" description:"设备状态"`
36
+	MessageId           string    `json:"message_id" gorm:"type:varchar(255); COMMENT:'设备消息id'" description:"设备消息id"`
37
+	UserId              uint64    `json:"user_id" gorm:"type:bigint(20) unsigned; DEFAULT:'0'; COMMENT:'用户ID'" description:"用户ID"`
38
+	UserHealthProfileId int64     `json:"user_health_profile_id" gorm:"type:bigint(20); DEFAULT:'0'; COMMENT:'健康档案ID'" description:"健康档案ID"`
39
+	View                int       `json:"view" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'查看:1(已查看) 0(未查看)'" description:"查看:1(已查看) 0(未查看)"`
40
+	AlertItemIds        string    `json:"alert_item_ids" gorm:"type:varchar(255); COMMENT:'异常项目id (1,2,3)'" description:"异常项目id (1,2,3)"`
41
+	Acc                 int       `json:"acc" gorm:"type:int(10); COMMENT:'设备检测次数'" description:"设备检测次数"`
42
+	Ctime               time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间 '" description:"创建时间 "`
43
+	Mtime               time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间'" description:"更新时间"`
44
+	DeleteFlag          int       `json:"delete_flag" gorm:"type:int(1); DEFAULT:'0'; COMMENT:'删除标志'" description:"删除标志"`
45
 }
45
 }
46
 
46
 
47
 func (CheckRecord) TableName() string {
47
 func (CheckRecord) TableName() string {
52
 type CheckRecordItem struct {
52
 type CheckRecordItem struct {
53
 	Id              int64     `json:"id" gorm:"type:bigint(20) auto_increment; NOT NULL; primary_key"`
53
 	Id              int64     `json:"id" gorm:"type:bigint(20) auto_increment; NOT NULL; primary_key"`
54
 	CheckId         int64     `json:"check_id" gorm:"type:bigint(20); NOT NULL; DEFAULT:'0'"`
54
 	CheckId         int64     `json:"check_id" gorm:"type:bigint(20); NOT NULL; DEFAULT:'0'"`
55
-	CheckItemId     int       `json:"check_item_id" gorm:"type:int(11); COMMENT:'检测项目id'"`
56
-	CheckValue      string    `json:"check_value" gorm:"type:varchar(255); COMMENT:'检测结果数值'"`
57
-	CheckValueIndex int       `json:"check_value_index" gorm:"type:int(3); COMMENT:'check_item value index'"`
55
+	CheckItemId     int       `json:"check_item_id" gorm:"type:int(11); COMMENT:'检测项目id'" description:"检测项目id"`
56
+	CheckValue      string    `json:"check_value" gorm:"type:varchar(255); COMMENT:'检测结果数值'" description:"检测结果数值"`
57
+	CheckValueIndex int       `json:"check_value_index" gorm:"type:int(3); COMMENT:'check_item value index'" description:"check_item value index"`
58
 	Ctime           time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP"`
58
 	Ctime           time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP"`
59
 	Mtime           time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"`
59
 	Mtime           time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"`
60
-	DeleteFlag      int       `json:"delete_flag" gorm:"type:int(11); COMMENT:'删除标志'"`
60
+	DeleteFlag      int       `json:"delete_flag" gorm:"type:int(11); COMMENT:'删除标志'" description:"删除标志"`
61
 }
61
 }
62
 
62
 
63
 func (CheckRecordItem) TableName() string {
63
 func (CheckRecordItem) TableName() string {
66
 
66
 
67
 //设备表
67
 //设备表
68
 type Device struct {
68
 type Device struct {
69
-	Id                   uint64    `json:"id" gorm:"type:bigint(20) unsigned auto_increment; NOT NULL; primary_key; COMMENT:'设备ID'"`
70
-	Name                 string    `json:"name" gorm:"type:varchar(255); COMMENT:'设备名称'"`
71
-	Serialno             string    `json:"serialno" gorm:"type:varchar(64); COMMENT:'设备编号'"`
72
-	DeviceName           string    `json:"device_name" gorm:"type:varchar(255); COMMENT:'设备名称'"`
73
-	DeviceType           string    `json:"device_type" gorm:"type:varchar(11); COMMENT:'设备类型'"`
74
-	InformType           int       `json:"inform_type" gorm:"type:int(1); COMMENT:'通知类型:0跳转小程序、1跳转网页 、默认跳转小程序'"`
69
+	Id                   uint64    `json:"id" gorm:"type:bigint(20) unsigned auto_increment; NOT NULL; primary_key; COMMENT:'设备ID'" description:"设备ID"`
70
+	Name                 string    `json:"name" gorm:"type:varchar(255); COMMENT:'设备名称'" description:"设备名称"`
71
+	Serialno             string    `json:"serialno" gorm:"type:varchar(64); COMMENT:'设备编号'" description:"设备编号"`
72
+	DeviceName           string    `json:"device_name" gorm:"type:varchar(255); COMMENT:'设备名称'" description:"设备名称"`
73
+	DeviceType           string    `json:"device_type" gorm:"type:varchar(11); COMMENT:'设备类型'" description:"设备类型"`
74
+	InformType           int       `json:"inform_type" gorm:"type:int(1); COMMENT:'通知类型:0跳转小程序、1跳转网页 、默认跳转小程序'" description:"通知类型:0跳转小程序、1跳转网页 、默认跳转小程序"`
75
 	Mac                  string    `json:"mac" gorm:"type:varchar(255)"`
75
 	Mac                  string    `json:"mac" gorm:"type:varchar(255)"`
76
 	Mcu                  string    `json:"mcu" gorm:"type:varchar(255)"`
76
 	Mcu                  string    `json:"mcu" gorm:"type:varchar(255)"`
77
-	BatchNumber          int       `json:"batch_number" gorm:"type:int(10); COMMENT:'批号'"`
78
-	ProductionDateNumber int       `json:"production_date_number" gorm:"type:int(10); COMMENT:'生产日期'"`
79
-	Number               int       `json:"number" gorm:"type:int(10); COMMENT:'序号'"`
77
+	BatchNumber          int       `json:"batch_number" gorm:"type:int(10); COMMENT:'批号'" description:"批号"`
78
+	ProductionDateNumber int       `json:"production_date_number" gorm:"type:int(10); COMMENT:'生产日期'" description:"生产日期"`
79
+	Number               int       `json:"number" gorm:"type:int(10); COMMENT:'序号'" description:"序号"`
80
 	QrCodeId             int64     `json:"qr_code_id" gorm:"type:bigint(20)"`
80
 	QrCodeId             int64     `json:"qr_code_id" gorm:"type:bigint(20)"`
81
-	EmqPassword          string    `json:"emq_password" gorm:"type:varchar(255); COMMENT:'emq密码'"`
82
-	Status               int       `json:"status" gorm:"type:int(2); DEFAULT:'0'; COMMENT:'状态(0:未分配 1:已分配 2:包装中 3:待出厂 6:废弃 99:已出厂 100:销售中 101:已售出)'"`
83
-	Ver                  string    `json:"ver" gorm:"type:varchar(255); COMMENT:'软件版本'"`
84
-	OemCompany           int       `json:"oem_company" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'厂商(0:自营  1:艾玛OEM)'"`
85
-	McuType              string    `json:"mcu_type" gorm:"type:varchar(32); COMMENT:'MCU芯片类型'"`
86
-	SensorMode           string    `json:"sensor_mode" gorm:"type:varchar(32); COMMENT:'传感放大倍数'"`
87
-	Language             string    `json:"language" gorm:"type:varchar(32); COMMENT:'语言'"`
88
-	PaperCheck           int       `json:"paper_check" gorm:"type:int(11); COMMENT:'试纸检查状态'"`
89
-	WifiVer              string    `json:"wifi_ver" gorm:"type:varchar(32); COMMENT:'WIFI版本'"`
90
-	Ctime                time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'"`
91
-	Mtime                time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '"`
92
-	DeleteFlag           int       `json:"delete_flag" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'删除标志'"`
81
+	EmqPassword          string    `json:"emq_password" gorm:"type:varchar(255); COMMENT:'emq密码'" description:"emq密码"`
82
+	Status               int       `json:"status" gorm:"type:int(2); DEFAULT:'0'; COMMENT:'状态(0:未分配 1:已分配 2:包装中 3:待出厂 6:废弃 99:已出厂 100:销售中 101:已售出)'" description:"状态(0:未分配 1:已分配 2:包装中 3:待出厂 6:废弃 99:已出厂 100:销售中 101:已售出)"`
83
+	Ver                  string    `json:"ver" gorm:"type:varchar(255); COMMENT:'软件版本'" description:"软件版本"`
84
+	OemCompany           int       `json:"oem_company" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'厂商(0:自营  1:艾玛OEM)'" description:"厂商(0:自营  1:艾玛OEM)"`
85
+	McuType              string    `json:"mcu_type" gorm:"type:varchar(32); COMMENT:'MCU芯片类型'" description:"MCU芯片类型"`
86
+	SensorMode           string    `json:"sensor_mode" gorm:"type:varchar(32); COMMENT:'传感放大倍数'" description:"传感放大倍数"`
87
+	Language             string    `json:"language" gorm:"type:varchar(32); COMMENT:'语言'" description:"语言"`
88
+	PaperCheck           int       `json:"paper_check" gorm:"type:int(11); COMMENT:'试纸检查状态'" description:"试纸检查状态"`
89
+	WifiVer              string    `json:"wifi_ver" gorm:"type:varchar(32); COMMENT:'WIFI版本'" description:"WIFI版本"`
90
+	Ctime                time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'" description:"创建时间"`
91
+	Mtime                time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '" description:"更新时间 "`
92
+	DeleteFlag           int       `json:"delete_flag" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'删除标志'" description:"删除标志"`
93
 }
93
 }
94
 
94
 
95
 func (Device) TableName() string {
95
 func (Device) TableName() string {
103
 	DeviceName string    `json:"device_name" gorm:"type:varchar(255)"`
103
 	DeviceName string    `json:"device_name" gorm:"type:varchar(255)"`
104
 	Topic      string    `json:"topic" gorm:"type:varchar(255)"`
104
 	Topic      string    `json:"topic" gorm:"type:varchar(255)"`
105
 	EventType  string    `json:"event_type" gorm:"type:varchar(255)"`
105
 	EventType  string    `json:"event_type" gorm:"type:varchar(255)"`
106
-	Content    string    `json:"content" gorm:"type:text; COMMENT:'消息内容'"`
107
-	Ctime      time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'"`
106
+	Content    string    `json:"content" gorm:"type:text; COMMENT:'消息内容'" description:"消息内容"`
107
+	Ctime      time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'" description:"创建时间"`
108
 }
108
 }
109
 
109
 
110
 func (DeviceMessageLog) TableName() string {
110
 func (DeviceMessageLog) TableName() string {
113
 
113
 
114
 //设备绑定表
114
 //设备绑定表
115
 type DeviceRelate struct {
115
 type DeviceRelate struct {
116
-	Id         int64     `json:"id" gorm:"type:bigint(20) auto_increment; NOT NULL; primary_key; COMMENT:'id'"`
117
-	Name       string    `json:"name" gorm:"type:varchar(255); COMMENT:'名称'"`
118
-	DeviceId   uint64    `json:"device_id" gorm:"type:bigint(20) unsigned; COMMENT:'设备Id'"`
119
-	UserId     uint64    `json:"user_id" gorm:"type:bigint(20) unsigned; COMMENT:'会员Id'"`
120
-	Ctime      time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'"`
121
-	Mtime      time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '"`
122
-	DeleteFlag int       `json:"delete_flag" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'删除标志(解绑时标记为删除)'"`
116
+	Id         int64     `json:"id" gorm:"type:bigint(20) auto_increment; NOT NULL; primary_key; COMMENT:'id'" description:"id"`
117
+	Name       string    `json:"name" gorm:"type:varchar(255); COMMENT:'名称'" description:"名称"`
118
+	DeviceId   uint64    `json:"device_id" gorm:"type:bigint(20) unsigned; COMMENT:'设备Id'" description:"设备Id"`
119
+	UserId     uint64    `json:"user_id" gorm:"type:bigint(20) unsigned; COMMENT:'会员Id'" description:"会员Id"`
120
+	Ctime      time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'" description:"创建时间"`
121
+	Mtime      time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '" description:"更新时间 "`
122
+	DeleteFlag int       `json:"delete_flag" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'删除标志(解绑时标记为删除)'" description:"删除标志(解绑时标记为删除)"`
123
 }
123
 }
124
 
124
 
125
 func (DeviceRelate) TableName() string {
125
 func (DeviceRelate) TableName() string {
133
 	Type       string    `json:"type" gorm:"type:varchar(255)"`
133
 	Type       string    `json:"type" gorm:"type:varchar(255)"`
134
 	ParentId   int       `json:"parent_id" gorm:"type:int(11)"`
134
 	ParentId   int       `json:"parent_id" gorm:"type:int(11)"`
135
 	Ctime      time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP"`
135
 	Ctime      time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP"`
136
-	DeleteFlag int       `json:"delete_flag" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'删除标志'"`
136
+	DeleteFlag int       `json:"delete_flag" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'删除标志'" description:"删除标志"`
137
 }
137
 }
138
 
138
 
139
 func (SysDictionary) TableName() string {
139
 func (SysDictionary) TableName() string {
142
 
142
 
143
 //用户健康档案
143
 //用户健康档案
144
 type UserHealthProfile struct {
144
 type UserHealthProfile struct {
145
-	Id                  uint64    `json:"id" gorm:"type:bigint(20) unsigned auto_increment; NOT NULL; primary_key; COMMENT:'Primary Key ID'"`
146
-	UserId              uint64    `json:"user_id" gorm:"type:bigint(20) unsigned; NOT NULL; COMMENT:'用户ID'"`
147
-	RealName            string    `json:"real_name" gorm:"type:varchar(64); COMMENT:'真实姓名'"`
148
-	IdCard              string    `json:"id_card" gorm:"type:varchar(64); COMMENT:'身份证号'"`
149
-	InpatientRegPhone   string    `json:"inpatient_reg_phone" gorm:"type:varchar(32); COMMENT:'住院登记手机号'"`
150
-	Gender              int       `json:"gender" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'性别(0:未知 1:男 2:女)'"`
151
-	Height              int       `json:"height" gorm:"type:int(11); COMMENT:'身高'"`
152
-	Weight              int       `json:"weight" gorm:"type:int(11); COMMENT:'体重'"`
153
-	BloodType           string    `json:"blood_type" gorm:"type:varchar(32); COMMENT:'血型'"`
154
-	Birthday            time.Time `json:"birthday" gorm:"type:datetime; COMMENT:'生日'"`
155
-	IllnessState        string    `json:"illness_state" gorm:"type:varchar(255); COMMENT:'病情'"`
156
-	RenalFunctionStatus int       `json:"renal_function_status" gorm:"type:int(11); COMMENT:'肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'"`
157
-	Creatinine          int       `json:"creatinine" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'血肌酐'"`
158
-	CreatinineUnit      string    `json:"creatinine_unit" gorm:"type:varchar(32); COMMENT:'肌酐单位(umol/L,mg/dl)'"`
159
-	CreatineTime        time.Time `json:"creatine_time" gorm:"type:datetime; COMMENT:'肌酐检测时间'"`
160
-	UrineProtein24hUnit string    `json:"urine_protein_24h_unit" gorm:"type:varchar(32); COMMENT:'24小时尿蛋白单位(g/24h,mg/24h)'"`
161
-	UrineProtein24h     int       `json:"urine_protein_24h" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'24小时尿蛋白'"`
162
-	UrineProtein24hTime time.Time `json:"urine_protein_24h_time" gorm:"type:datetime; COMMENT:'24小时尿蛋白检测时间'"`
163
-	UrineProtein        int       `json:"urine_protein" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'尿蛋白'"`
164
-	UrineProteinUnit    string    `json:"urine_protein_unit" gorm:"type:varchar(32); COMMENT:'尿蛋白单位(g,mg)'"`
165
-	UrineProteinTime    time.Time `json:"urine_protein_time" gorm:"type:datetime; COMMENT:'尿蛋白检测时间'"`
166
-	Status              int       `json:"status" gorm:"type:int(11); DEFAULT:'1'; COMMENT:'状态(1:有效 0:无效 )'"`
167
-	Ctime               time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'"`
168
-	Mtime               time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '"`
145
+	Id                  uint64    `json:"id" gorm:"type:bigint(20) unsigned auto_increment; NOT NULL; primary_key; COMMENT:'Primary Key ID'" description:"Primary Key ID"`
146
+	UserId              uint64    `json:"user_id" gorm:"type:bigint(20) unsigned; NOT NULL; COMMENT:'用户ID'" description:"用户ID"`
147
+	RealName            string    `json:"real_name" gorm:"type:varchar(64); COMMENT:'真实姓名'" description:"真实姓名"`
148
+	IdCard              string    `json:"id_card" gorm:"type:varchar(64); COMMENT:'身份证号'" description:"身份证号"`
149
+	InpatientRegPhone   string    `json:"inpatient_reg_phone" gorm:"type:varchar(32); COMMENT:'住院登记手机号'" description:"住院登记手机号"`
150
+	Gender              int       `json:"gender" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'性别(0:未知 1:男 2:女)'" description:"性别(0:未知 1:男 2:女)"`
151
+	Height              int       `json:"height" gorm:"type:int(11); COMMENT:'身高'" description:"身高"`
152
+	Weight              int       `json:"weight" gorm:"type:int(11); COMMENT:'体重'" description:"体重"`
153
+	BloodType           string    `json:"blood_type" gorm:"type:varchar(32); COMMENT:'血型'" description:"血型"`
154
+	Birthday            time.Time `json:"birthday" gorm:"type:datetime; COMMENT:'生日'" description:"生日"`
155
+	IllnessState        string    `json:"illness_state" gorm:"type:varchar(255); COMMENT:'病情'" description:"病情"`
156
+	RenalFunctionStatus int       `json:"renal_function_status" gorm:"type:int(11); COMMENT:'肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'" description:"肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)"`
157
+	Creatinine          int       `json:"creatinine" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'血肌酐'" description:"血肌酐"`
158
+	CreatinineUnit      string    `json:"creatinine_unit" gorm:"type:varchar(32); COMMENT:'肌酐单位(umol/L,mg/dl)'" description:"肌酐单位(umol/L,mg/dl)"`
159
+	CreatineTime        time.Time `json:"creatine_time" gorm:"type:datetime; COMMENT:'肌酐检测时间'" description:"肌酐检测时间"`
160
+	UrineProtein24hUnit string    `json:"urine_protein_24h_unit" gorm:"type:varchar(32); COMMENT:'24小时尿蛋白单位(g/24h,mg/24h)'" description:"24小时尿蛋白单位(g/24h,mg/24h)"`
161
+	UrineProtein24h     int       `json:"urine_protein_24h" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'24小时尿蛋白'" description:"24小时尿蛋白"`
162
+	UrineProtein24hTime time.Time `json:"urine_protein_24h_time" gorm:"type:datetime; COMMENT:'24小时尿蛋白检测时间'" description:"24小时尿蛋白检测时间"`
163
+	UrineProtein        int       `json:"urine_protein" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'尿蛋白'" description:"尿蛋白"`
164
+	UrineProteinUnit    string    `json:"urine_protein_unit" gorm:"type:varchar(32); COMMENT:'尿蛋白单位(g,mg)'" description:"尿蛋白单位(g,mg)"`
165
+	UrineProteinTime    time.Time `json:"urine_protein_time" gorm:"type:datetime; COMMENT:'尿蛋白检测时间'" description:"尿蛋白检测时间"`
166
+	Status              int       `json:"status" gorm:"type:int(11); DEFAULT:'1'; COMMENT:'状态(1:有效 0:无效 )'" description:"状态(1:有效 0:无效 )"`
167
+	Ctime               time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'" description:"创建时间"`
168
+	Mtime               time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '" description:"更新时间 "`
169
 }
169
 }
170
 
170
 
171
 func (UserHealthProfile) TableName() string {
171
 func (UserHealthProfile) TableName() string {
174
 
174
 
175
 //小程序用户表(个人中心)
175
 //小程序用户表(个人中心)
176
 type XcxUser struct {
176
 type XcxUser struct {
177
-	Id                      uint64    `json:"id" gorm:"type:bigint(20) unsigned auto_increment; NOT NULL; primary_key; COMMENT:'Primary Key ID'"`
178
-	Phone                   string    `json:"phone" gorm:"type:varchar(32); COMMENT:'手机号码'"`
179
-	Email                   string    `json:"email" gorm:"type:varchar(255); COMMENT:'邮件'"`
180
-	OpenId                  string    `json:"open_id" gorm:"type:varchar(255); COMMENT:'OpenID'"`
181
-	UnionId                 string    `json:"union_id" gorm:"type:varchar(255); COMMENT:'unionid'"`
182
-	NickName                string    `json:"nick_name" gorm:"type:varchar(64); COMMENT:'昵称'"`
183
-	Avatar                  string    `json:"avatar" gorm:"type:varchar(255); COMMENT:'头像'"`
184
-	Status                  int       `json:"status" gorm:"type:int(11); DEFAULT:'1'; COMMENT:'状态(1:有效 0: 无效)'"`
185
-	RoleType                int       `json:"role_type" gorm:"type:int(2); COMMENT:'角色类型 0或空:普通 1:管理员 2:测试'"`
186
-	Source                  string    `json:"source" gorm:"type:varchar(255); COMMENT:'用户来源'"`
187
-	PrivacyProtocolVersions int       `json:"privacy_protocol_versions" gorm:"type:int(2); COMMENT:'隐私政策版本'"`
188
-	Ctime                   time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'"`
189
-	Mtime                   time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '"`
177
+	Id                      uint64    `json:"id" gorm:"type:bigint(20) unsigned auto_increment; NOT NULL; primary_key; COMMENT:'Primary Key ID'" description:"Primary Key ID"`
178
+	Phone                   string    `json:"phone" gorm:"type:varchar(32); COMMENT:'手机号码'" description:"手机号码"`
179
+	Email                   string    `json:"email" gorm:"type:varchar(255); COMMENT:'邮件'" description:"邮件"`
180
+	OpenId                  string    `json:"open_id" gorm:"type:varchar(255); COMMENT:'OpenID'" description:"OpenID"`
181
+	UnionId                 string    `json:"union_id" gorm:"type:varchar(255); COMMENT:'unionid'" description:"unionid"`
182
+	NickName                string    `json:"nick_name" gorm:"type:varchar(64); COMMENT:'昵称'" description:"昵称"`
183
+	Avatar                  string    `json:"avatar" gorm:"type:varchar(255); COMMENT:'头像'" description:"头像"`
184
+	Status                  int       `json:"status" gorm:"type:int(11); DEFAULT:'1'; COMMENT:'状态(1:有效 0: 无效)'" description:"状态(1:有效 0: 无效)"`
185
+	RoleType                int       `json:"role_type" gorm:"type:int(2); COMMENT:'角色类型 0或空:普通 1:管理员 2:测试'" description:"角色类型 0或空:普通 1:管理员 2:测试"`
186
+	Source                  string    `json:"source" gorm:"type:varchar(255); COMMENT:'用户来源'" description:"用户来源"`
187
+	PrivacyProtocolVersions int       `json:"privacy_protocol_versions" gorm:"type:int(2); COMMENT:'隐私政策版本'" description:"隐私政策版本"`
188
+	Ctime                   time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'" description:"创建时间"`
189
+	Mtime                   time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '" description:"更新时间 "`
190
 
190
 
191
 	SessionKey string `json:"session_key" gorm:"-"`
191
 	SessionKey string `json:"session_key" gorm:"-"`
192
 }
192
 }

+ 66 - 66
models/httpmodels.go View File

12
 }
12
 }
13
 
13
 
14
 type SaveUserInfoReq struct {
14
 type SaveUserInfoReq struct {
15
-	Phone string `json:"phone" COMMENT:"手机号码"`
16
-	Email string `json:"email" COMMENT:"邮件"`
17
-	//UnionId                 string `json:"union_id" COMMENT:"unionid"`
18
-	NickName string `json:"nick_name" COMMENT:"昵称"`
19
-	Avatar   string `json:"avatar" COMMENT:"头像"`
20
-	//PrivacyProtocolVersions int    `json:"privacy_protocol_versions" COMMENT:"隐私政策版本"`
15
+	Phone string `json:"phone" description:"手机号码"`
16
+	Email string `json:"email" description:"邮件"`
17
+	//UnionId                 string `json:"union_id" description:"unionid"`
18
+	NickName string `json:"nick_name" description:"昵称"`
19
+	Avatar   string `json:"avatar" description:"头像"`
20
+	//PrivacyProtocolVersions int    `json:"privacy_protocol_versions" description:"隐私政策版本"`
21
 
21
 
22
-	RealName          string `json:"real_name" gorm:"type:varchar(64); COMMENT:'真实姓名'"`
23
-	IdCard            string `json:"id_card" gorm:"type:varchar(64); COMMENT:'身份证号'"`
24
-	InpatientRegPhone string `json:"inpatient_reg_phone" gorm:"type:varchar(32); COMMENT:'住院登记手机号'"`
22
+	RealName          string `json:"real_name" description:"真实姓名"`
23
+	IdCard            string `json:"id_card" description:"身份证号"`
24
+	InpatientRegPhone string `json:"inpatient_reg_phone" description:"住院登记手机号"`
25
 }
25
 }
26
 
26
 
27
 type UserInfoResp struct {
27
 type UserInfoResp struct {
28
-	Id                      uint64 `json:"id" COMMENT:"Primary Key ID"`
29
-	Phone                   string `json:"phone" COMMENT:"手机号码"`
30
-	Email                   string `json:"email" COMMENT:"邮件"`
31
-	OpenId                  string `json:"open_id" COMMENT:"OpenID"`
32
-	UnionId                 string `json:"union_id" COMMENT:"unionid"`
33
-	NickName                string `json:"nick_name" COMMENT:"昵称"`
34
-	Avatar                  string `json:"avatar" COMMENT:"头像"`
35
-	Status                  int    `json:"status" COMMENT:"状态(1:有效 0: 无效)"`
36
-	Source                  string `json:"source" COMMENT:"用户来源"`
37
-	PrivacyProtocolVersions int    `json:"privacy_protocol_versions" COMMENT:"隐私政策版本"`
28
+	Id                      uint64 `json:"id" description:"Primary Key ID"`
29
+	Phone                   string `json:"phone" description:"手机号码"`
30
+	Email                   string `json:"email" description:"邮件"`
31
+	OpenId                  string `json:"open_id" description:"OpenID"`
32
+	UnionId                 string `json:"union_id" description:"unionid"`
33
+	NickName                string `json:"nick_name" description:"昵称"`
34
+	Avatar                  string `json:"avatar" description:"头像"`
35
+	Status                  int    `json:"status" description:"状态(1:有效0:无效)"`
36
+	Source                  string `json:"source" description:"用户来源"`
37
+	PrivacyProtocolVersions int    `json:"privacy_protocol_versions" description:"隐私政策版本"`
38
 
38
 
39
-	RealName          string `json:"real_name" gorm:"type:varchar(64); COMMENT:'真实姓名'"`
40
-	IdCard            string `json:"id_card" gorm:"type:varchar(64); COMMENT:'身份证号'"`
41
-	InpatientRegPhone string `json:"inpatient_reg_phone" gorm:"type:varchar(32); COMMENT:'住院登记手机号'"`
39
+	RealName          string `json:"real_name" description:"真实姓名"`
40
+	IdCard            string `json:"id_card" description:"身份证号"`
41
+	InpatientRegPhone string `json:"inpatient_reg_phone" description:"住院登记手机号"`
42
 
42
 
43
-	Ctime time.Time `json:"ctime" COMMENT:"创建时间"`
44
-	Mtime time.Time `json:"mtime" COMMENT:"更新时间 "`
43
+	Ctime time.Time `json:"ctime" description:"创建时间"`
44
+	Mtime time.Time `json:"mtime" description:"更新时间 "`
45
 }
45
 }
46
 
46
 
47
 type SaveHealthProfileReq struct {
47
 type SaveHealthProfileReq struct {
48
-	Gender              int       `json:"gender" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'性别(0:未知 1:男 2:女)'"`
49
-	Height              int       `json:"height" gorm:"type:int(11); COMMENT:'身高'"`
50
-	Weight              int       `json:"weight" gorm:"type:int(11); COMMENT:'体重'"`
51
-	BloodType           string    `json:"blood_type" gorm:"type:varchar(32); COMMENT:'血型'"`
52
-	Birthday            time.Time `json:"birthday" gorm:"type:datetime; COMMENT:'生日'"`
53
-	IllnessState        string    `json:"illness_state" gorm:"type:varchar(255); COMMENT:'病情'"`
54
-	RenalFunctionStatus int       `json:"renal_function_status" gorm:"type:int(11); COMMENT:'肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'"`
55
-	Creatinine          int       `json:"creatinine" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'血肌酐'"`
56
-	CreatinineUnit      string    `json:"creatinine_unit" gorm:"type:varchar(32); COMMENT:'肌酐单位(umol/L,mg/dl)'"`
57
-	CreatineTime        time.Time `json:"creatine_time" gorm:"type:datetime; COMMENT:'肌酐检测时间'"`
58
-	UrineProtein24hUnit string    `json:"urine_protein_24h_unit" gorm:"type:varchar(32); COMMENT:'24小时尿蛋白单位(g/24h,mg/24h)'"`
59
-	UrineProtein24h     int       `json:"urine_protein_24h" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'24小时尿蛋白'"`
60
-	UrineProtein24hTime time.Time `json:"urine_protein_24h_time" gorm:"type:datetime; COMMENT:'24小时尿蛋白检测时间'"`
61
-	UrineProtein        int       `json:"urine_protein" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'尿蛋白'"`
62
-	UrineProteinUnit    string    `json:"urine_protein_unit" gorm:"type:varchar(32); COMMENT:'尿蛋白单位(g,mg)'"`
63
-	UrineProteinTime    time.Time `json:"urine_protein_time" gorm:"type:datetime; COMMENT:'尿蛋白检测时间'"`
48
+	Gender              int       `json:"gender" description:"性别(0:未知 1:男 2:女)"`
49
+	Height              int       `json:"height" description:"身高"`
50
+	Weight              int       `json:"weight" description:"体重"`
51
+	BloodType           string    `json:"blood_type" description:"血型"`
52
+	Birthday            time.Time `json:"birthday" description:"生日"`
53
+	IllnessState        string    `json:"illness_state" description:"病情"`
54
+	RenalFunctionStatus int       `json:"renal_function_status" description:"肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)"`
55
+	Creatinine          int       `json:"creatinine" description:"血肌酐"`
56
+	CreatinineUnit      string    `json:"creatinine_unit" description:"肌酐单位(umol/L,mg/dl)"`
57
+	CreatineTime        time.Time `json:"creatine_time" description:"肌酐检测时间"`
58
+	UrineProtein24hUnit string    `json:"urine_protein_24h_unit" description:"24小时尿蛋白单位(g/24h,mg/24h)"`
59
+	UrineProtein24h     int       `json:"urine_protein_24h" description:"24小时尿蛋白"`
60
+	UrineProtein24hTime time.Time `json:"urine_protein_24h_time" description:"24小时尿蛋白检测时间"`
61
+	UrineProtein        int       `json:"urine_protein" description:"尿蛋白"`
62
+	UrineProteinUnit    string    `json:"urine_protein_unit" description:"尿蛋白单位(g,mg)"`
63
+	UrineProteinTime    time.Time `json:"urine_protein_time" description:"尿蛋白检测时间"`
64
 }
64
 }
65
 
65
 
66
 type HealthProfileResp struct {
66
 type HealthProfileResp struct {
67
-	Id uint64 `json:"id" gorm:"type:bigint(20) unsigned auto_increment; NOT NULL; primary_key; COMMENT:'Primary Key ID'"`
68
-	//UserId              int64     `json:"user_id" gorm:"type:bigint(20); NOT NULL; COMMENT:'用户ID'"`
69
-	//RealName            string    `json:"real_name" gorm:"type:varchar(64); COMMENT:'真实姓名'"`
70
-	//IdCard              string    `json:"id_card" gorm:"type:varchar(64); COMMENT:'身份证号'"`
71
-	//InpatientRegPhone   string    `json:"inpatient_reg_phone" gorm:"type:varchar(32); COMMENT:'住院登记手机号'"`
72
-	Gender              int       `json:"gender" gorm:"type:int(11); DEFAULT:'0'; COMMENT:'性别(0:未知 1:男 2:女)'"`
73
-	Height              int       `json:"height" gorm:"type:int(11); COMMENT:'身高'"`
74
-	Weight              int       `json:"weight" gorm:"type:int(11); COMMENT:'体重'"`
75
-	BloodType           string    `json:"blood_type" gorm:"type:varchar(32); COMMENT:'血型'"`
76
-	Birthday            time.Time `json:"birthday" gorm:"type:datetime; COMMENT:'生日'"`
77
-	IllnessState        string    `json:"illness_state" gorm:"type:varchar(255); COMMENT:'病情'"`
78
-	RenalFunctionStatus int       `json:"renal_function_status" gorm:"type:int(11); COMMENT:'肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'"`
79
-	Creatinine          int       `json:"creatinine" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'血肌酐'"`
80
-	CreatinineUnit      string    `json:"creatinine_unit" gorm:"type:varchar(32); COMMENT:'肌酐单位(umol/L,mg/dl)'"`
81
-	CreatineTime        time.Time `json:"creatine_time" gorm:"type:datetime; COMMENT:'肌酐检测时间'"`
82
-	UrineProtein24hUnit string    `json:"urine_protein_24h_unit" gorm:"type:varchar(32); COMMENT:'24小时尿蛋白单位(g/24h,mg/24h)'"`
83
-	UrineProtein24h     int       `json:"urine_protein_24h" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'24小时尿蛋白'"`
84
-	UrineProtein24hTime time.Time `json:"urine_protein_24h_time" gorm:"type:datetime; COMMENT:'24小时尿蛋白检测时间'"`
85
-	UrineProtein        int       `json:"urine_protein" gorm:"type:int(11); NOT NULL; DEFAULT:'0'; COMMENT:'尿蛋白'"`
86
-	UrineProteinUnit    string    `json:"urine_protein_unit" gorm:"type:varchar(32); COMMENT:'尿蛋白单位(g,mg)'"`
87
-	UrineProteinTime    time.Time `json:"urine_protein_time" gorm:"type:datetime; COMMENT:'尿蛋白检测时间'"`
88
-	Status              int       `json:"status" gorm:"type:int(11); DEFAULT:'1'; COMMENT:'状态(1:有效 0:无效 )'"`
89
-	Ctime               time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP; COMMENT:'创建时间'"`
90
-	Mtime               time.Time `json:"mtime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; COMMENT:'更新时间 '"`
67
+	Id uint64 `json:"id" description:"Primary Key ID"`
68
+	//UserId              int64     `json:"user_id" description:"用户ID"`
69
+	//RealName            string    `json:"real_name" description:"真实姓名"`
70
+	//IdCard              string    `json:"id_card" description:"身份证号"`
71
+	//InpatientRegPhone   string    `json:"inpatient_reg_phone" description:"住院登记手机号"`
72
+	Gender              int       `json:"gender" description:"性别(0:未知 1:男 2:女)"`
73
+	Height              int       `json:"height" description:"身高"`
74
+	Weight              int       `json:"weight" description:"体重"`
75
+	BloodType           string    `json:"blood_type" description:"血型"`
76
+	Birthday            time.Time `json:"birthday" description:"生日"`
77
+	IllnessState        string    `json:"illness_state" description:"病情"`
78
+	RenalFunctionStatus int       `json:"renal_function_status" description:"肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)"`
79
+	Creatinine          int       `json:"creatinine" description:"血肌酐"`
80
+	CreatinineUnit      string    `json:"creatinine_unit" description:"肌酐单位(umol/L,mg/dl)"`
81
+	CreatineTime        time.Time `json:"creatine_time" description:"肌酐检测时间"`
82
+	UrineProtein24hUnit string    `json:"urine_protein_24h_unit" description:"24小时尿蛋白单位(g/24h,mg/24h)"`
83
+	UrineProtein24h     int       `json:"urine_protein_24h" description:"24小时尿蛋白"`
84
+	UrineProtein24hTime time.Time `json:"urine_protein_24h_time" description:"24小时尿蛋白检测时间"`
85
+	UrineProtein        int       `json:"urine_protein" description:"尿蛋白"`
86
+	UrineProteinUnit    string    `json:"urine_protein_unit" description:"尿蛋白单位(g,mg)"`
87
+	UrineProteinTime    time.Time `json:"urine_protein_time" description:"尿蛋白检测时间"`
88
+	Status              int       `json:"status" description:"状态(1:有效 0:无效 )"`
89
+	Ctime               time.Time `json:"ctime" description:"创建时间"`
90
+	Mtime               time.Time `json:"mtime" description:"更新时间 "`
91
 }
91
 }
92
 
92
 
93
 type DicResp struct {
93
 type DicResp struct {
94
 	Type  string `json:"type"`
94
 	Type  string `json:"type"`
95
-	Name  string `json:"name"`
96
-	Value int    `json:"value"`
95
+	Name  string `json:"name" description:"字典名称"`
96
+	Value int    `json:"value" description:"字典值"`
97
 }
97
 }

+ 23 - 0
service/checkitemservice.go View File

1
+package service
2
+
3
+import (
4
+	"sws_xcx/models"
5
+
6
+	"github.com/jinzhu/gorm"
7
+)
8
+
9
+type CheckItemService struct {
10
+	rdb *gorm.DB
11
+}
12
+
13
+func NewCheckItemService() *CheckItemService {
14
+	return &CheckItemService{
15
+		rdb: ReadDB().Model(&models.CheckItem{}),
16
+	}
17
+}
18
+
19
+func (s *CheckItemService) GetCheckItems(lang string) ([]*models.CheckItem, error) {
20
+	var items []*models.CheckItem
21
+	err := s.rdb.Where("language = ? and delete_flag = ?", lang, 0).Order("check_item_number").Find(&items).Error
22
+	return items, err
23
+}

+ 23 - 0
service/checkrecordservice.go View File

1
+package service
2
+
3
+import (
4
+	"sws_xcx/models"
5
+
6
+	"github.com/jinzhu/gorm"
7
+)
8
+
9
+type CheckRecordService struct {
10
+	rdb *gorm.DB
11
+	wdb *gorm.DB
12
+}
13
+
14
+func NewCheckRecordService() *CheckRecordService {
15
+	return &CheckRecordService{
16
+		rdb: ReadDB(),
17
+		wdb: WriteDB(),
18
+	}
19
+}
20
+
21
+func (s *CheckRecordService) GetCheckRecordList(pageNum, pageSize int, search string) ([]*models.CheckRecord, int, error) {
22
+	return nil, 0, nil
23
+}

+ 97 - 0
service/deviceservice.go View File

1
+package service
2
+
3
+import (
4
+	"errors"
5
+	"sws_xcx/models"
6
+
7
+	"github.com/jinzhu/gorm"
8
+)
9
+
10
+type DeviceService struct {
11
+	rdb *gorm.DB
12
+	wdb *gorm.DB
13
+}
14
+
15
+func NewDeviceService() *DeviceService {
16
+	return &DeviceService{
17
+		rdb: ReadDB(),
18
+		wdb: WriteDB(),
19
+	}
20
+}
21
+
22
+func (s *DeviceService) GetDeviceInfo(id int) (*models.Device, error) {
23
+	var device models.Device
24
+	err := s.rdb.Model(&device).First(&device, id).Error
25
+	if err != nil {
26
+		return nil, err
27
+	}
28
+	return &device, nil
29
+}
30
+
31
+func (s *DeviceService) GetMyDevices(userId uint64) ([]*models.Device, error) {
32
+	var devices []*models.Device
33
+	sql := "select d.* from device as d inner join device_relate as dr on d.id = dr.device_id where dr.user_id = ? and dr.delete_flag = 0"
34
+	err := s.rdb.Raw(sql).Scan(&devices).Error
35
+	if err != nil {
36
+		return nil, err
37
+	}
38
+	return devices, nil
39
+}
40
+
41
+func (s *DeviceService) BindDevice(userId uint64, deviceId uint64) error {
42
+	var device models.Device
43
+	err := s.rdb.Model(&device).Where("id = ?  and delete_flag =0", deviceId).First(&device).Error
44
+	if err != nil {
45
+		if err == gorm.ErrRecordNotFound {
46
+			return errors.New("设备不存在")
47
+		}
48
+		return err
49
+	}
50
+	dr := &models.DeviceRelate{}
51
+	err = s.rdb.Model(dr).Where("device_id = ?", deviceId).First(dr).Error
52
+	if err != nil {
53
+		if err == gorm.ErrRecordNotFound {
54
+			dr = &models.DeviceRelate{
55
+				UserId:   userId,
56
+				DeviceId: deviceId,
57
+				Name:     device.DeviceName,
58
+			}
59
+
60
+			return s.wdb.Model(dr).Create(dr).Error
61
+		}
62
+		return err
63
+	}
64
+
65
+	if dr.UserId != userId {
66
+		if dr.DeleteFlag == 0 {
67
+			return errors.New("该设备已绑定其他用户")
68
+		} else { //其他用户解绑了设备
69
+			return s.wdb.Model(dr).Update("delete_flag", 0, "user_id", userId).Error
70
+		}
71
+	} else if dr.DeleteFlag == 1 { //直接解绑了该设备 重新绑定
72
+
73
+		return s.wdb.Model(dr).Update("delete_flag", 0).Error
74
+
75
+	} else {
76
+		return errors.New("设备已绑定")
77
+	}
78
+
79
+}
80
+
81
+func (s *DeviceService) UnbindDevice(userId uint64, deviceId uint64) error {
82
+	var device models.Device
83
+	err := s.rdb.Model(&device).Where("id = ? and delete_flag =0", deviceId).First(&device).Error
84
+	if err != nil {
85
+		if err == gorm.ErrRecordNotFound {
86
+			return errors.New("设备不存在")
87
+		}
88
+		return err
89
+	}
90
+
91
+	dr := &models.DeviceRelate{}
92
+	err = s.rdb.Model(dr).Where("device_id = ? and user_id = ?", deviceId, userId).First(dr).Error
93
+	if err != nil {
94
+		return err
95
+	}
96
+	return s.wdb.Model(dr).Update("delete_flag", 1).Error
97
+}

+ 3 - 3
service/sysdicservice.go View File

9
 
9
 
10
 type SysDicService struct {
10
 type SysDicService struct {
11
 	rdb *gorm.DB
11
 	rdb *gorm.DB
12
-	wdb *gorm.DB
12
+	//wdb *gorm.DB
13
 }
13
 }
14
 
14
 
15
 func NewSysDicService() *SysDicService {
15
 func NewSysDicService() *SysDicService {
17
 	return &SysDicService{
17
 	return &SysDicService{
18
 
18
 
19
 		rdb: ReadDB().Model(dic),
19
 		rdb: ReadDB().Model(dic),
20
-		wdb: WriteDB().Model(dic),
20
+		//wdb: WriteDB().Model(dic),
21
 	}
21
 	}
22
 }
22
 }
23
 
23
 
24
 func (s *SysDicService) GetDicsByType(t string) ([]*models.SysDictionary, error) {
24
 func (s *SysDicService) GetDicsByType(t string) ([]*models.SysDictionary, error) {
25
 	var dics []*models.SysDictionary
25
 	var dics []*models.SysDictionary
26
-	err := s.rdb.Where("name_en = ? and parent_id>0", t).Scan(&dics).Error
26
+	err := s.rdb.Where("name_en = ? and parent_id>0", t).Find(&dics).Error
27
 	return dics, err
27
 	return dics, err
28
 }
28
 }
29
 
29
 

+ 331 - 8
swagger/swagger.json View File

11
     },
11
     },
12
     "basePath": "/xcx",
12
     "basePath": "/xcx",
13
     "paths": {
13
     "paths": {
14
+        "/api/sysdic/getcheckitems": {
15
+            "get": {
16
+                "tags": [
17
+                    "api/sysdic"
18
+                ],
19
+                "description": "获取检测项目列表\n\u003cbr\u003e",
20
+                "operationId": "SysDicApiController.GetCheckItems",
21
+                "responses": {
22
+                    "200": {
23
+                        "description": "success",
24
+                        "schema": {
25
+                            "type": "array",
26
+                            "items": {
27
+                                "$ref": "#/definitions/models.CheckItem"
28
+                            }
29
+                        }
30
+                    },
31
+                    "500": {
32
+                        "description": "error"
33
+                    }
34
+                }
35
+            }
36
+        },
37
+        "/api/sysdic/getdevicetypes": {
38
+            "get": {
39
+                "tags": [
40
+                    "api/sysdic"
41
+                ],
42
+                "description": "获取设备类型列表\n\u003cbr\u003e",
43
+                "operationId": "SysDicApiController.GetDeviceTypes",
44
+                "responses": {
45
+                    "200": {
46
+                        "description": "success",
47
+                        "schema": {
48
+                            "type": "array",
49
+                            "items": {
50
+                                "$ref": "#/definitions/models.DicResp"
51
+                            }
52
+                        }
53
+                    },
54
+                    "500": {
55
+                        "description": "error"
56
+                    }
57
+                }
58
+            }
59
+        },
14
         "/api/sysdic/getillness": {
60
         "/api/sysdic/getillness": {
15
             "get": {
61
             "get": {
16
                 "tags": [
62
                 "tags": [
20
                 "operationId": "SysDicApiController.GetIllness",
66
                 "operationId": "SysDicApiController.GetIllness",
21
                 "responses": {
67
                 "responses": {
22
                     "200": {
68
                     "200": {
23
-                        "description": "DicResp success",
69
+                        "description": "success",
24
                         "schema": {
70
                         "schema": {
25
-                            "$ref": "#/definitions/models.type"
71
+                            "type": "array",
72
+                            "items": {
73
+                                "$ref": "#/definitions/models.DicResp"
74
+                            }
26
                         }
75
                         }
27
                     },
76
                     },
28
                     "500": {
77
                     "500": {
40
                 "operationId": "SysDicApiController.GetRenalStatus",
89
                 "operationId": "SysDicApiController.GetRenalStatus",
41
                 "responses": {
90
                 "responses": {
42
                     "200": {
91
                     "200": {
43
-                        "description": "DicResp success",
92
+                        "description": "success",
44
                         "schema": {
93
                         "schema": {
45
-                            "$ref": "#/definitions/models.type"
94
+                            "type": "array",
95
+                            "items": {
96
+                                "$ref": "#/definitions/models.DicResp"
97
+                            }
46
                         }
98
                         }
47
                     },
99
                     },
48
                     "500": {
100
                     "500": {
236
         }
288
         }
237
     },
289
     },
238
     "definitions": {
290
     "definitions": {
291
+        "models.CheckItem": {
292
+            "title": "CheckItem",
293
+            "type": "object",
294
+            "properties": {
295
+                "check_item_number": {
296
+                    "description": "排序",
297
+                    "type": "integer",
298
+                    "format": "int64"
299
+                },
300
+                "check_type": {
301
+                    "description": "检测类型(试纸类型)",
302
+                    "type": "string"
303
+                },
304
+                "ctime": {
305
+                    "description": "创建时间",
306
+                    "type": "string",
307
+                    "format": "datetime"
308
+                },
309
+                "delete_flag": {
310
+                    "description": "删除标志",
311
+                    "type": "integer",
312
+                    "format": "int64"
313
+                },
314
+                "details": {
315
+                    "description": "描述",
316
+                    "type": "string"
317
+                },
318
+                "device_type": {
319
+                    "description": "设备类型",
320
+                    "type": "string"
321
+                },
322
+                "id": {
323
+                    "description": "检测项目ID",
324
+                    "type": "integer",
325
+                    "format": "int64"
326
+                },
327
+                "language": {
328
+                    "description": "cn: 中文 en 英文",
329
+                    "type": "string"
330
+                },
331
+                "mtime": {
332
+                    "description": "更新时间 ",
333
+                    "type": "string",
334
+                    "format": "datetime"
335
+                },
336
+                "name_cn": {
337
+                    "description": "检测项目中文名",
338
+                    "type": "string"
339
+                },
340
+                "name_en": {
341
+                    "description": "检测项目英文名",
342
+                    "type": "string"
343
+                },
344
+                "reference_value": {
345
+                    "description": " 参考值",
346
+                    "type": "string"
347
+                },
348
+                "remark": {
349
+                    "description": "备注",
350
+                    "type": "string"
351
+                },
352
+                "scope_list": {
353
+                    "description": "范围value 值,type =1为正常、2及以上为异 常",
354
+                    "type": "string"
355
+                },
356
+                "text": {
357
+                    "description": "文本",
358
+                    "type": "string"
359
+                },
360
+                "unit": {
361
+                    "description": "单位",
362
+                    "type": "string"
363
+                }
364
+            }
365
+        },
366
+        "models.Device": {
367
+            "title": "Device",
368
+            "type": "object",
369
+            "properties": {
370
+                "batch_number": {
371
+                    "description": "批号",
372
+                    "type": "integer",
373
+                    "format": "int64"
374
+                },
375
+                "ctime": {
376
+                    "description": "创建时间",
377
+                    "type": "string",
378
+                    "format": "datetime"
379
+                },
380
+                "delete_flag": {
381
+                    "description": "删除标志",
382
+                    "type": "integer",
383
+                    "format": "int64"
384
+                },
385
+                "device_name": {
386
+                    "description": "设备名称",
387
+                    "type": "string"
388
+                },
389
+                "device_type": {
390
+                    "description": "设备类型",
391
+                    "type": "string"
392
+                },
393
+                "emq_password": {
394
+                    "description": "emq密码",
395
+                    "type": "string"
396
+                },
397
+                "id": {
398
+                    "description": "设备ID",
399
+                    "type": "integer",
400
+                    "format": "int64"
401
+                },
402
+                "inform_type": {
403
+                    "description": "通知类型:0跳转小程序、1跳转网页 、默认跳转小程序",
404
+                    "type": "integer",
405
+                    "format": "int64"
406
+                },
407
+                "language": {
408
+                    "description": "语言",
409
+                    "type": "string"
410
+                },
411
+                "mac": {
412
+                    "type": "string"
413
+                },
414
+                "mcu": {
415
+                    "type": "string"
416
+                },
417
+                "mcu_type": {
418
+                    "description": "MCU芯片类型",
419
+                    "type": "string"
420
+                },
421
+                "mtime": {
422
+                    "description": "更新时间 ",
423
+                    "type": "string",
424
+                    "format": "datetime"
425
+                },
426
+                "name": {
427
+                    "description": "设备名称",
428
+                    "type": "string"
429
+                },
430
+                "number": {
431
+                    "description": "序号",
432
+                    "type": "integer",
433
+                    "format": "int64"
434
+                },
435
+                "oem_company": {
436
+                    "description": "厂商(0:自营  1:艾玛OEM)",
437
+                    "type": "integer",
438
+                    "format": "int64"
439
+                },
440
+                "paper_check": {
441
+                    "description": "试纸检查状态",
442
+                    "type": "integer",
443
+                    "format": "int64"
444
+                },
445
+                "production_date_number": {
446
+                    "description": "生产日期",
447
+                    "type": "integer",
448
+                    "format": "int64"
449
+                },
450
+                "qr_code_id": {
451
+                    "type": "integer",
452
+                    "format": "int64"
453
+                },
454
+                "sensor_mode": {
455
+                    "description": "传感放大倍数",
456
+                    "type": "string"
457
+                },
458
+                "serialno": {
459
+                    "description": "设备编号",
460
+                    "type": "string"
461
+                },
462
+                "status": {
463
+                    "description": "状态(0:未分配 1:已分配 2:包装中 3:待出厂 6:废弃 99:已出厂 100:销售中 101:已售出)",
464
+                    "type": "integer",
465
+                    "format": "int64"
466
+                },
467
+                "ver": {
468
+                    "description": "软件版本",
469
+                    "type": "string"
470
+                },
471
+                "wifi_ver": {
472
+                    "description": "WIFI版本",
473
+                    "type": "string"
474
+                }
475
+            }
476
+        },
477
+        "models.DicResp": {
478
+            "title": "DicResp",
479
+            "type": "object",
480
+            "properties": {
481
+                "name": {
482
+                    "description": "字典名称",
483
+                    "type": "string"
484
+                },
485
+                "type": {
486
+                    "type": "string"
487
+                },
488
+                "value": {
489
+                    "description": "字典值",
490
+                    "type": "integer",
491
+                    "format": "int64"
492
+                }
493
+            }
494
+        },
239
         "models.HealthProfileResp": {
495
         "models.HealthProfileResp": {
240
             "title": "HealthProfileResp",
496
             "title": "HealthProfileResp",
241
             "type": "object",
497
             "type": "object",
242
             "properties": {
498
             "properties": {
243
                 "birthday": {
499
                 "birthday": {
500
+                    "description": "生日",
244
                     "type": "string",
501
                     "type": "string",
245
                     "format": "datetime"
502
                     "format": "datetime"
246
                 },
503
                 },
247
                 "blood_type": {
504
                 "blood_type": {
505
+                    "description": "血型",
248
                     "type": "string"
506
                     "type": "string"
249
                 },
507
                 },
250
                 "creatine_time": {
508
                 "creatine_time": {
509
+                    "description": "肌酐检测时间",
251
                     "type": "string",
510
                     "type": "string",
252
                     "format": "datetime"
511
                     "format": "datetime"
253
                 },
512
                 },
254
                 "creatinine": {
513
                 "creatinine": {
514
+                    "description": "血肌酐",
255
                     "type": "integer",
515
                     "type": "integer",
256
                     "format": "int64"
516
                     "format": "int64"
257
                 },
517
                 },
258
                 "creatinine_unit": {
518
                 "creatinine_unit": {
519
+                    "description": "肌酐单位(umol/L,mg/dl)",
259
                     "type": "string"
520
                     "type": "string"
260
                 },
521
                 },
261
                 "ctime": {
522
                 "ctime": {
523
+                    "description": "创建时间",
262
                     "type": "string",
524
                     "type": "string",
263
                     "format": "datetime"
525
                     "format": "datetime"
264
                 },
526
                 },
265
                 "gender": {
527
                 "gender": {
528
+                    "description": "性别(0:未知 1:男 2:女)",
266
                     "type": "integer",
529
                     "type": "integer",
267
                     "format": "int64"
530
                     "format": "int64"
268
                 },
531
                 },
269
                 "height": {
532
                 "height": {
533
+                    "description": "身高",
270
                     "type": "integer",
534
                     "type": "integer",
271
                     "format": "int64"
535
                     "format": "int64"
272
                 },
536
                 },
273
                 "id": {
537
                 "id": {
538
+                    "description": "Primary Key ID",
274
                     "type": "integer",
539
                     "type": "integer",
275
                     "format": "int64"
540
                     "format": "int64"
276
                 },
541
                 },
277
                 "illness_state": {
542
                 "illness_state": {
543
+                    "description": "病情",
278
                     "type": "string"
544
                     "type": "string"
279
                 },
545
                 },
280
                 "mtime": {
546
                 "mtime": {
547
+                    "description": "更新时间 ",
281
                     "type": "string",
548
                     "type": "string",
282
                     "format": "datetime"
549
                     "format": "datetime"
283
                 },
550
                 },
284
                 "renal_function_status": {
551
                 "renal_function_status": {
552
+                    "description": "肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)",
285
                     "type": "integer",
553
                     "type": "integer",
286
                     "format": "int64"
554
                     "format": "int64"
287
                 },
555
                 },
288
                 "status": {
556
                 "status": {
557
+                    "description": "状态(1:有效 0:无效 )",
289
                     "type": "integer",
558
                     "type": "integer",
290
                     "format": "int64"
559
                     "format": "int64"
291
                 },
560
                 },
292
                 "urine_protein": {
561
                 "urine_protein": {
562
+                    "description": "尿蛋白",
293
                     "type": "integer",
563
                     "type": "integer",
294
                     "format": "int64"
564
                     "format": "int64"
295
                 },
565
                 },
296
                 "urine_protein_24h": {
566
                 "urine_protein_24h": {
567
+                    "description": "24小时尿蛋白",
297
                     "type": "integer",
568
                     "type": "integer",
298
                     "format": "int64"
569
                     "format": "int64"
299
                 },
570
                 },
300
                 "urine_protein_24h_time": {
571
                 "urine_protein_24h_time": {
572
+                    "description": "24小时尿蛋白检测时间",
301
                     "type": "string",
573
                     "type": "string",
302
                     "format": "datetime"
574
                     "format": "datetime"
303
                 },
575
                 },
304
                 "urine_protein_24h_unit": {
576
                 "urine_protein_24h_unit": {
577
+                    "description": "24小时尿蛋白单位(g/24h,mg/24h)",
305
                     "type": "string"
578
                     "type": "string"
306
                 },
579
                 },
307
                 "urine_protein_time": {
580
                 "urine_protein_time": {
581
+                    "description": "尿蛋白检测时间",
308
                     "type": "string",
582
                     "type": "string",
309
                     "format": "datetime"
583
                     "format": "datetime"
310
                 },
584
                 },
311
                 "urine_protein_unit": {
585
                 "urine_protein_unit": {
586
+                    "description": "尿蛋白单位(g,mg)",
312
                     "type": "string"
587
                     "type": "string"
313
                 },
588
                 },
314
                 "weight": {
589
                 "weight": {
590
+                    "description": "体重",
315
                     "type": "integer",
591
                     "type": "integer",
316
                     "format": "int64"
592
                     "format": "int64"
317
                 }
593
                 }
322
             "type": "object",
598
             "type": "object",
323
             "properties": {
599
             "properties": {
324
                 "birthday": {
600
                 "birthday": {
601
+                    "description": "生日",
325
                     "type": "string",
602
                     "type": "string",
326
                     "format": "datetime"
603
                     "format": "datetime"
327
                 },
604
                 },
328
                 "blood_type": {
605
                 "blood_type": {
606
+                    "description": "血型",
329
                     "type": "string"
607
                     "type": "string"
330
                 },
608
                 },
331
                 "creatine_time": {
609
                 "creatine_time": {
610
+                    "description": "肌酐检测时间",
332
                     "type": "string",
611
                     "type": "string",
333
                     "format": "datetime"
612
                     "format": "datetime"
334
                 },
613
                 },
335
                 "creatinine": {
614
                 "creatinine": {
615
+                    "description": "血肌酐",
336
                     "type": "integer",
616
                     "type": "integer",
337
                     "format": "int64"
617
                     "format": "int64"
338
                 },
618
                 },
339
                 "creatinine_unit": {
619
                 "creatinine_unit": {
620
+                    "description": "肌酐单位(umol/L,mg/dl)",
340
                     "type": "string"
621
                     "type": "string"
341
                 },
622
                 },
342
                 "gender": {
623
                 "gender": {
624
+                    "description": "性别(0:未知 1:男 2:女)",
343
                     "type": "integer",
625
                     "type": "integer",
344
                     "format": "int64"
626
                     "format": "int64"
345
                 },
627
                 },
346
                 "height": {
628
                 "height": {
629
+                    "description": "身高",
347
                     "type": "integer",
630
                     "type": "integer",
348
                     "format": "int64"
631
                     "format": "int64"
349
                 },
632
                 },
350
                 "illness_state": {
633
                 "illness_state": {
634
+                    "description": "病情",
351
                     "type": "string"
635
                     "type": "string"
352
                 },
636
                 },
353
                 "renal_function_status": {
637
                 "renal_function_status": {
638
+                    "description": "肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)",
354
                     "type": "integer",
639
                     "type": "integer",
355
                     "format": "int64"
640
                     "format": "int64"
356
                 },
641
                 },
357
                 "urine_protein": {
642
                 "urine_protein": {
643
+                    "description": "尿蛋白",
358
                     "type": "integer",
644
                     "type": "integer",
359
                     "format": "int64"
645
                     "format": "int64"
360
                 },
646
                 },
361
                 "urine_protein_24h": {
647
                 "urine_protein_24h": {
648
+                    "description": "24小时尿蛋白",
362
                     "type": "integer",
649
                     "type": "integer",
363
                     "format": "int64"
650
                     "format": "int64"
364
                 },
651
                 },
365
                 "urine_protein_24h_time": {
652
                 "urine_protein_24h_time": {
653
+                    "description": "24小时尿蛋白检测时间",
366
                     "type": "string",
654
                     "type": "string",
367
                     "format": "datetime"
655
                     "format": "datetime"
368
                 },
656
                 },
369
                 "urine_protein_24h_unit": {
657
                 "urine_protein_24h_unit": {
658
+                    "description": "24小时尿蛋白单位(g/24h,mg/24h)",
370
                     "type": "string"
659
                     "type": "string"
371
                 },
660
                 },
372
                 "urine_protein_time": {
661
                 "urine_protein_time": {
662
+                    "description": "尿蛋白检测时间",
373
                     "type": "string",
663
                     "type": "string",
374
                     "format": "datetime"
664
                     "format": "datetime"
375
                 },
665
                 },
376
                 "urine_protein_unit": {
666
                 "urine_protein_unit": {
667
+                    "description": "尿蛋白单位(g,mg)",
377
                     "type": "string"
668
                     "type": "string"
378
                 },
669
                 },
379
                 "weight": {
670
                 "weight": {
671
+                    "description": "体重",
380
                     "type": "integer",
672
                     "type": "integer",
381
                     "format": "int64"
673
                     "format": "int64"
382
                 }
674
                 }
387
             "type": "object",
679
             "type": "object",
388
             "properties": {
680
             "properties": {
389
                 "avatar": {
681
                 "avatar": {
682
+                    "description": "头像",
390
                     "type": "string"
683
                     "type": "string"
391
                 },
684
                 },
392
                 "email": {
685
                 "email": {
686
+                    "description": "邮件",
393
                     "type": "string"
687
                     "type": "string"
394
                 },
688
                 },
395
                 "id_card": {
689
                 "id_card": {
690
+                    "description": "身份证号",
396
                     "type": "string"
691
                     "type": "string"
397
                 },
692
                 },
398
                 "inpatient_reg_phone": {
693
                 "inpatient_reg_phone": {
694
+                    "description": "住院登记手机号",
399
                     "type": "string"
695
                     "type": "string"
400
                 },
696
                 },
401
                 "nick_name": {
697
                 "nick_name": {
698
+                    "description": "昵称",
402
                     "type": "string"
699
                     "type": "string"
403
                 },
700
                 },
404
                 "phone": {
701
                 "phone": {
702
+                    "description": "手机号码",
405
                     "type": "string"
703
                     "type": "string"
406
                 },
704
                 },
407
                 "real_name": {
705
                 "real_name": {
706
+                    "description": "真实姓名",
408
                     "type": "string"
707
                     "type": "string"
409
                 }
708
                 }
410
             }
709
             }
414
             "type": "object",
713
             "type": "object",
415
             "properties": {
714
             "properties": {
416
                 "avatar": {
715
                 "avatar": {
716
+                    "description": "头像",
417
                     "type": "string"
717
                     "type": "string"
418
                 },
718
                 },
419
                 "ctime": {
719
                 "ctime": {
720
+                    "description": "创建时间",
420
                     "type": "string",
721
                     "type": "string",
421
                     "format": "datetime"
722
                     "format": "datetime"
422
                 },
723
                 },
423
                 "email": {
724
                 "email": {
725
+                    "description": "邮件",
424
                     "type": "string"
726
                     "type": "string"
425
                 },
727
                 },
426
                 "id": {
728
                 "id": {
729
+                    "description": "Primary Key ID",
427
                     "type": "integer",
730
                     "type": "integer",
428
                     "format": "int64"
731
                     "format": "int64"
429
                 },
732
                 },
430
                 "id_card": {
733
                 "id_card": {
734
+                    "description": "身份证号",
431
                     "type": "string"
735
                     "type": "string"
432
                 },
736
                 },
433
                 "inpatient_reg_phone": {
737
                 "inpatient_reg_phone": {
738
+                    "description": "住院登记手机号",
434
                     "type": "string"
739
                     "type": "string"
435
                 },
740
                 },
436
                 "mtime": {
741
                 "mtime": {
742
+                    "description": "更新时间 ",
437
                     "type": "string",
743
                     "type": "string",
438
                     "format": "datetime"
744
                     "format": "datetime"
439
                 },
745
                 },
440
                 "nick_name": {
746
                 "nick_name": {
747
+                    "description": "昵称",
441
                     "type": "string"
748
                     "type": "string"
442
                 },
749
                 },
443
                 "open_id": {
750
                 "open_id": {
751
+                    "description": "OpenID",
444
                     "type": "string"
752
                     "type": "string"
445
                 },
753
                 },
446
                 "phone": {
754
                 "phone": {
755
+                    "description": "手机号码",
447
                     "type": "string"
756
                     "type": "string"
448
                 },
757
                 },
449
                 "privacy_protocol_versions": {
758
                 "privacy_protocol_versions": {
759
+                    "description": "隐私政策版本",
450
                     "type": "integer",
760
                     "type": "integer",
451
                     "format": "int64"
761
                     "format": "int64"
452
                 },
762
                 },
453
                 "real_name": {
763
                 "real_name": {
764
+                    "description": "真实姓名",
454
                     "type": "string"
765
                     "type": "string"
455
                 },
766
                 },
456
                 "source": {
767
                 "source": {
768
+                    "description": "用户来源",
457
                     "type": "string"
769
                     "type": "string"
458
                 },
770
                 },
459
                 "status": {
771
                 "status": {
772
+                    "description": "状态(1:有效0:无效)",
460
                     "type": "integer",
773
                     "type": "integer",
461
                     "format": "int64"
774
                     "format": "int64"
462
                 },
775
                 },
463
                 "union_id": {
776
                 "union_id": {
777
+                    "description": "unionid",
464
                     "type": "string"
778
                     "type": "string"
465
                 }
779
                 }
466
             }
780
             }
491
             "type": "object",
805
             "type": "object",
492
             "properties": {
806
             "properties": {
493
                 "avatar": {
807
                 "avatar": {
808
+                    "description": "头像",
494
                     "type": "string"
809
                     "type": "string"
495
                 },
810
                 },
496
                 "ctime": {
811
                 "ctime": {
812
+                    "description": "创建时间",
497
                     "type": "string",
813
                     "type": "string",
498
                     "format": "datetime"
814
                     "format": "datetime"
499
                 },
815
                 },
500
                 "email": {
816
                 "email": {
817
+                    "description": "邮件",
501
                     "type": "string"
818
                     "type": "string"
502
                 },
819
                 },
503
                 "id": {
820
                 "id": {
821
+                    "description": "Primary Key ID",
504
                     "type": "integer",
822
                     "type": "integer",
505
                     "format": "int64"
823
                     "format": "int64"
506
                 },
824
                 },
507
                 "mtime": {
825
                 "mtime": {
826
+                    "description": "更新时间 ",
508
                     "type": "string",
827
                     "type": "string",
509
                     "format": "datetime"
828
                     "format": "datetime"
510
                 },
829
                 },
511
                 "nick_name": {
830
                 "nick_name": {
831
+                    "description": "昵称",
512
                     "type": "string"
832
                     "type": "string"
513
                 },
833
                 },
514
                 "open_id": {
834
                 "open_id": {
835
+                    "description": "OpenID",
515
                     "type": "string"
836
                     "type": "string"
516
                 },
837
                 },
517
                 "phone": {
838
                 "phone": {
839
+                    "description": "手机号码",
518
                     "type": "string"
840
                     "type": "string"
519
                 },
841
                 },
520
                 "privacy_protocol_versions": {
842
                 "privacy_protocol_versions": {
843
+                    "description": "隐私政策版本",
521
                     "type": "integer",
844
                     "type": "integer",
522
                     "format": "int64"
845
                     "format": "int64"
523
                 },
846
                 },
524
                 "role_type": {
847
                 "role_type": {
848
+                    "description": "角色类型 0或空:普通 1:管理员 2:测试",
525
                     "type": "integer",
849
                     "type": "integer",
526
                     "format": "int64"
850
                     "format": "int64"
527
                 },
851
                 },
529
                     "type": "string"
853
                     "type": "string"
530
                 },
854
                 },
531
                 "source": {
855
                 "source": {
856
+                    "description": "用户来源",
532
                     "type": "string"
857
                     "type": "string"
533
                 },
858
                 },
534
                 "status": {
859
                 "status": {
860
+                    "description": "状态(1:有效 0: 无效)",
535
                     "type": "integer",
861
                     "type": "integer",
536
                     "format": "int64"
862
                     "format": "int64"
537
                 },
863
                 },
538
                 "union_id": {
864
                 "union_id": {
865
+                    "description": "unionid",
539
                     "type": "string"
866
                     "type": "string"
540
                 }
867
                 }
541
             }
868
             }
542
-        },
543
-        "models.type": {
544
-            "title": "type",
545
-            "type": "object"
546
         }
869
         }
547
     },
870
     },
548
     "securityDefinitions": {
871
     "securityDefinitions": {

+ 268 - 7
swagger/swagger.yml View File

8
     name: 领透科技
8
     name: 领透科技
9
 basePath: /xcx
9
 basePath: /xcx
10
 paths:
10
 paths:
11
+  /api/sysdic/getcheckitems:
12
+    get:
13
+      tags:
14
+      - api/sysdic
15
+      description: |-
16
+        获取检测项目列表
17
+        <br>
18
+      operationId: SysDicApiController.GetCheckItems
19
+      responses:
20
+        "200":
21
+          description: success
22
+          schema:
23
+            type: array
24
+            items:
25
+              $ref: '#/definitions/models.CheckItem'
26
+        "500":
27
+          description: error
28
+  /api/sysdic/getdevicetypes:
29
+    get:
30
+      tags:
31
+      - api/sysdic
32
+      description: |-
33
+        获取设备类型列表
34
+        <br>
35
+      operationId: SysDicApiController.GetDeviceTypes
36
+      responses:
37
+        "200":
38
+          description: success
39
+          schema:
40
+            type: array
41
+            items:
42
+              $ref: '#/definitions/models.DicResp'
43
+        "500":
44
+          description: error
11
   /api/sysdic/getillness:
45
   /api/sysdic/getillness:
12
     get:
46
     get:
13
       tags:
47
       tags:
18
       operationId: SysDicApiController.GetIllness
52
       operationId: SysDicApiController.GetIllness
19
       responses:
53
       responses:
20
         "200":
54
         "200":
21
-          description: DicResp success
55
+          description: success
22
           schema:
56
           schema:
23
-            $ref: '#/definitions/models.type'
57
+            type: array
58
+            items:
59
+              $ref: '#/definitions/models.DicResp'
24
         "500":
60
         "500":
25
           description: error
61
           description: error
26
   /api/sysdic/getrenalstatus:
62
   /api/sysdic/getrenalstatus:
33
       operationId: SysDicApiController.GetRenalStatus
69
       operationId: SysDicApiController.GetRenalStatus
34
       responses:
70
       responses:
35
         "200":
71
         "200":
36
-          description: DicResp success
72
+          description: success
37
           schema:
73
           schema:
38
-            $ref: '#/definitions/models.type'
74
+            type: array
75
+            items:
76
+              $ref: '#/definitions/models.DicResp'
39
         "500":
77
         "500":
40
           description: error
78
           description: error
41
   /api/user/gethealthprofile:
79
   /api/user/gethealthprofile:
163
       security:
201
       security:
164
       - token: []
202
       - token: []
165
 definitions:
203
 definitions:
204
+  models.CheckItem:
205
+    title: CheckItem
206
+    type: object
207
+    properties:
208
+      check_item_number:
209
+        description: 排序
210
+        type: integer
211
+        format: int64
212
+      check_type:
213
+        description: 检测类型(试纸类型)
214
+        type: string
215
+      ctime:
216
+        description: 创建时间
217
+        type: string
218
+        format: datetime
219
+      delete_flag:
220
+        description: 删除标志
221
+        type: integer
222
+        format: int64
223
+      details:
224
+        description: 描述
225
+        type: string
226
+      device_type:
227
+        description: 设备类型
228
+        type: string
229
+      id:
230
+        description: 检测项目ID
231
+        type: integer
232
+        format: int64
233
+      language:
234
+        description: 'cn: 中文 en 英文'
235
+        type: string
236
+      mtime:
237
+        description: '更新时间 '
238
+        type: string
239
+        format: datetime
240
+      name_cn:
241
+        description: 检测项目中文名
242
+        type: string
243
+      name_en:
244
+        description: 检测项目英文名
245
+        type: string
246
+      reference_value:
247
+        description: ' 参考值'
248
+        type: string
249
+      remark:
250
+        description: 备注
251
+        type: string
252
+      scope_list:
253
+        description: 范围value 值,type =1为正常、2及以上为异 常
254
+        type: string
255
+      text:
256
+        description: 文本
257
+        type: string
258
+      unit:
259
+        description: 单位
260
+        type: string
261
+  models.Device:
262
+    title: Device
263
+    type: object
264
+    properties:
265
+      batch_number:
266
+        description: 批号
267
+        type: integer
268
+        format: int64
269
+      ctime:
270
+        description: 创建时间
271
+        type: string
272
+        format: datetime
273
+      delete_flag:
274
+        description: 删除标志
275
+        type: integer
276
+        format: int64
277
+      device_name:
278
+        description: 设备名称
279
+        type: string
280
+      device_type:
281
+        description: 设备类型
282
+        type: string
283
+      emq_password:
284
+        description: emq密码
285
+        type: string
286
+      id:
287
+        description: 设备ID
288
+        type: integer
289
+        format: int64
290
+      inform_type:
291
+        description: 通知类型:0跳转小程序、1跳转网页 、默认跳转小程序
292
+        type: integer
293
+        format: int64
294
+      language:
295
+        description: 语言
296
+        type: string
297
+      mac:
298
+        type: string
299
+      mcu:
300
+        type: string
301
+      mcu_type:
302
+        description: MCU芯片类型
303
+        type: string
304
+      mtime:
305
+        description: '更新时间 '
306
+        type: string
307
+        format: datetime
308
+      name:
309
+        description: 设备名称
310
+        type: string
311
+      number:
312
+        description: 序号
313
+        type: integer
314
+        format: int64
315
+      oem_company:
316
+        description: 厂商(0:自营  1:艾玛OEM)
317
+        type: integer
318
+        format: int64
319
+      paper_check:
320
+        description: 试纸检查状态
321
+        type: integer
322
+        format: int64
323
+      production_date_number:
324
+        description: 生产日期
325
+        type: integer
326
+        format: int64
327
+      qr_code_id:
328
+        type: integer
329
+        format: int64
330
+      sensor_mode:
331
+        description: 传感放大倍数
332
+        type: string
333
+      serialno:
334
+        description: 设备编号
335
+        type: string
336
+      status:
337
+        description: 状态(0:未分配 1:已分配 2:包装中 3:待出厂 6:废弃 99:已出厂 100:销售中 101:已售出)
338
+        type: integer
339
+        format: int64
340
+      ver:
341
+        description: 软件版本
342
+        type: string
343
+      wifi_ver:
344
+        description: WIFI版本
345
+        type: string
346
+  models.DicResp:
347
+    title: DicResp
348
+    type: object
349
+    properties:
350
+      name:
351
+        description: 字典名称
352
+        type: string
353
+      type:
354
+        type: string
355
+      value:
356
+        description: 字典值
357
+        type: integer
358
+        format: int64
166
   models.HealthProfileResp:
359
   models.HealthProfileResp:
167
     title: HealthProfileResp
360
     title: HealthProfileResp
168
     type: object
361
     type: object
169
     properties:
362
     properties:
170
       birthday:
363
       birthday:
364
+        description: 生日
171
         type: string
365
         type: string
172
         format: datetime
366
         format: datetime
173
       blood_type:
367
       blood_type:
368
+        description: 血型
174
         type: string
369
         type: string
175
       creatine_time:
370
       creatine_time:
371
+        description: 肌酐检测时间
176
         type: string
372
         type: string
177
         format: datetime
373
         format: datetime
178
       creatinine:
374
       creatinine:
375
+        description: 血肌酐
179
         type: integer
376
         type: integer
180
         format: int64
377
         format: int64
181
       creatinine_unit:
378
       creatinine_unit:
379
+        description: 肌酐单位(umol/L,mg/dl)
182
         type: string
380
         type: string
183
       ctime:
381
       ctime:
382
+        description: 创建时间
184
         type: string
383
         type: string
185
         format: datetime
384
         format: datetime
186
       gender:
385
       gender:
386
+        description: 性别(0:未知 1:男 2:女)
187
         type: integer
387
         type: integer
188
         format: int64
388
         format: int64
189
       height:
389
       height:
390
+        description: 身高
190
         type: integer
391
         type: integer
191
         format: int64
392
         format: int64
192
       id:
393
       id:
394
+        description: Primary Key ID
193
         type: integer
395
         type: integer
194
         format: int64
396
         format: int64
195
       illness_state:
397
       illness_state:
398
+        description: 病情
196
         type: string
399
         type: string
197
       mtime:
400
       mtime:
401
+        description: '更新时间 '
198
         type: string
402
         type: string
199
         format: datetime
403
         format: datetime
200
       renal_function_status:
404
       renal_function_status:
405
+        description: '肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'
201
         type: integer
406
         type: integer
202
         format: int64
407
         format: int64
203
       status:
408
       status:
409
+        description: 状态(1:有效 0:无效 )
204
         type: integer
410
         type: integer
205
         format: int64
411
         format: int64
206
       urine_protein:
412
       urine_protein:
413
+        description: 尿蛋白
207
         type: integer
414
         type: integer
208
         format: int64
415
         format: int64
209
       urine_protein_24h:
416
       urine_protein_24h:
417
+        description: 24小时尿蛋白
210
         type: integer
418
         type: integer
211
         format: int64
419
         format: int64
212
       urine_protein_24h_time:
420
       urine_protein_24h_time:
421
+        description: 24小时尿蛋白检测时间
213
         type: string
422
         type: string
214
         format: datetime
423
         format: datetime
215
       urine_protein_24h_unit:
424
       urine_protein_24h_unit:
425
+        description: 24小时尿蛋白单位(g/24h,mg/24h)
216
         type: string
426
         type: string
217
       urine_protein_time:
427
       urine_protein_time:
428
+        description: 尿蛋白检测时间
218
         type: string
429
         type: string
219
         format: datetime
430
         format: datetime
220
       urine_protein_unit:
431
       urine_protein_unit:
432
+        description: 尿蛋白单位(g,mg)
221
         type: string
433
         type: string
222
       weight:
434
       weight:
435
+        description: 体重
223
         type: integer
436
         type: integer
224
         format: int64
437
         format: int64
225
   models.SaveHealthProfileReq:
438
   models.SaveHealthProfileReq:
227
     type: object
440
     type: object
228
     properties:
441
     properties:
229
       birthday:
442
       birthday:
443
+        description: 生日
230
         type: string
444
         type: string
231
         format: datetime
445
         format: datetime
232
       blood_type:
446
       blood_type:
447
+        description: 血型
233
         type: string
448
         type: string
234
       creatine_time:
449
       creatine_time:
450
+        description: 肌酐检测时间
235
         type: string
451
         type: string
236
         format: datetime
452
         format: datetime
237
       creatinine:
453
       creatinine:
454
+        description: 血肌酐
238
         type: integer
455
         type: integer
239
         format: int64
456
         format: int64
240
       creatinine_unit:
457
       creatinine_unit:
458
+        description: 肌酐单位(umol/L,mg/dl)
241
         type: string
459
         type: string
242
       gender:
460
       gender:
461
+        description: 性别(0:未知 1:男 2:女)
243
         type: integer
462
         type: integer
244
         format: int64
463
         format: int64
245
       height:
464
       height:
465
+        description: 身高
246
         type: integer
466
         type: integer
247
         format: int64
467
         format: int64
248
       illness_state:
468
       illness_state:
469
+        description: 病情
249
         type: string
470
         type: string
250
       renal_function_status:
471
       renal_function_status:
472
+        description: '肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'
251
         type: integer
473
         type: integer
252
         format: int64
474
         format: int64
253
       urine_protein:
475
       urine_protein:
476
+        description: 尿蛋白
254
         type: integer
477
         type: integer
255
         format: int64
478
         format: int64
256
       urine_protein_24h:
479
       urine_protein_24h:
480
+        description: 24小时尿蛋白
257
         type: integer
481
         type: integer
258
         format: int64
482
         format: int64
259
       urine_protein_24h_time:
483
       urine_protein_24h_time:
484
+        description: 24小时尿蛋白检测时间
260
         type: string
485
         type: string
261
         format: datetime
486
         format: datetime
262
       urine_protein_24h_unit:
487
       urine_protein_24h_unit:
488
+        description: 24小时尿蛋白单位(g/24h,mg/24h)
263
         type: string
489
         type: string
264
       urine_protein_time:
490
       urine_protein_time:
491
+        description: 尿蛋白检测时间
265
         type: string
492
         type: string
266
         format: datetime
493
         format: datetime
267
       urine_protein_unit:
494
       urine_protein_unit:
495
+        description: 尿蛋白单位(g,mg)
268
         type: string
496
         type: string
269
       weight:
497
       weight:
498
+        description: 体重
270
         type: integer
499
         type: integer
271
         format: int64
500
         format: int64
272
   models.SaveUserInfoReq:
501
   models.SaveUserInfoReq:
274
     type: object
503
     type: object
275
     properties:
504
     properties:
276
       avatar:
505
       avatar:
506
+        description: 头像
277
         type: string
507
         type: string
278
       email:
508
       email:
509
+        description: 邮件
279
         type: string
510
         type: string
280
       id_card:
511
       id_card:
512
+        description: 身份证号
281
         type: string
513
         type: string
282
       inpatient_reg_phone:
514
       inpatient_reg_phone:
515
+        description: 住院登记手机号
283
         type: string
516
         type: string
284
       nick_name:
517
       nick_name:
518
+        description: 昵称
285
         type: string
519
         type: string
286
       phone:
520
       phone:
521
+        description: 手机号码
287
         type: string
522
         type: string
288
       real_name:
523
       real_name:
524
+        description: 真实姓名
289
         type: string
525
         type: string
290
   models.UserInfoResp:
526
   models.UserInfoResp:
291
     title: UserInfoResp
527
     title: UserInfoResp
292
     type: object
528
     type: object
293
     properties:
529
     properties:
294
       avatar:
530
       avatar:
531
+        description: 头像
295
         type: string
532
         type: string
296
       ctime:
533
       ctime:
534
+        description: 创建时间
297
         type: string
535
         type: string
298
         format: datetime
536
         format: datetime
299
       email:
537
       email:
538
+        description: 邮件
300
         type: string
539
         type: string
301
       id:
540
       id:
541
+        description: Primary Key ID
302
         type: integer
542
         type: integer
303
         format: int64
543
         format: int64
304
       id_card:
544
       id_card:
545
+        description: 身份证号
305
         type: string
546
         type: string
306
       inpatient_reg_phone:
547
       inpatient_reg_phone:
548
+        description: 住院登记手机号
307
         type: string
549
         type: string
308
       mtime:
550
       mtime:
551
+        description: '更新时间 '
309
         type: string
552
         type: string
310
         format: datetime
553
         format: datetime
311
       nick_name:
554
       nick_name:
555
+        description: 昵称
312
         type: string
556
         type: string
313
       open_id:
557
       open_id:
558
+        description: OpenID
314
         type: string
559
         type: string
315
       phone:
560
       phone:
561
+        description: 手机号码
316
         type: string
562
         type: string
317
       privacy_protocol_versions:
563
       privacy_protocol_versions:
564
+        description: 隐私政策版本
318
         type: integer
565
         type: integer
319
         format: int64
566
         format: int64
320
       real_name:
567
       real_name:
568
+        description: 真实姓名
321
         type: string
569
         type: string
322
       source:
570
       source:
571
+        description: 用户来源
323
         type: string
572
         type: string
324
       status:
573
       status:
574
+        description: 状态(1:有效0:无效)
325
         type: integer
575
         type: integer
326
         format: int64
576
         format: int64
327
       union_id:
577
       union_id:
578
+        description: unionid
328
         type: string
579
         type: string
329
   models.WxXcxLoginReq:
580
   models.WxXcxLoginReq:
330
     title: WxXcxLoginReq
581
     title: WxXcxLoginReq
345
     type: object
596
     type: object
346
     properties:
597
     properties:
347
       avatar:
598
       avatar:
599
+        description: 头像
348
         type: string
600
         type: string
349
       ctime:
601
       ctime:
602
+        description: 创建时间
350
         type: string
603
         type: string
351
         format: datetime
604
         format: datetime
352
       email:
605
       email:
606
+        description: 邮件
353
         type: string
607
         type: string
354
       id:
608
       id:
609
+        description: Primary Key ID
355
         type: integer
610
         type: integer
356
         format: int64
611
         format: int64
357
       mtime:
612
       mtime:
613
+        description: '更新时间 '
358
         type: string
614
         type: string
359
         format: datetime
615
         format: datetime
360
       nick_name:
616
       nick_name:
617
+        description: 昵称
361
         type: string
618
         type: string
362
       open_id:
619
       open_id:
620
+        description: OpenID
363
         type: string
621
         type: string
364
       phone:
622
       phone:
623
+        description: 手机号码
365
         type: string
624
         type: string
366
       privacy_protocol_versions:
625
       privacy_protocol_versions:
626
+        description: 隐私政策版本
367
         type: integer
627
         type: integer
368
         format: int64
628
         format: int64
369
       role_type:
629
       role_type:
630
+        description: 角色类型 0或空:普通 1:管理员 2:测试
370
         type: integer
631
         type: integer
371
         format: int64
632
         format: int64
372
       session_key:
633
       session_key:
373
         type: string
634
         type: string
374
       source:
635
       source:
636
+        description: 用户来源
375
         type: string
637
         type: string
376
       status:
638
       status:
639
+        description: 状态(1:有效 0: 无效)
377
         type: integer
640
         type: integer
378
         format: int64
641
         format: int64
379
       union_id:
642
       union_id:
643
+        description: unionid
380
         type: string
644
         type: string
381
-  models.type:
382
-    title: type
383
-    type: object
384
 securityDefinitions:
645
 securityDefinitions:
385
   token:
646
   token:
386
     type: apiKey
647
     type: apiKey