Rick.Lan пре 2 месеци
родитељ
комит
35f1ea1a0f

+ 1 - 0
.gitignore Прегледај датотеку

@@ -1,2 +1,3 @@
1 1
 sws_xcx.exe
2 2
 sws_xcx.exe~
3
+sws_xcx

+ 4 - 4
conf/app.conf Прегледај датотеку

@@ -15,9 +15,9 @@ qiniu_secretkey = DmZSp_Bmnp-9aUB7xUvoyViZpzmx1Rs2RL69GvlW
15 15
 qiniu_domain = https://images.shengws.com/
16 16
 qiniu_bucket = syhclub-storage
17 17
 
18
-#appid = "wxcdf53b48b7df107e"
18
+appid = "wxcdf53b48b7df107e"
19 19
 key="Yz1HgsFX3yJvWPJSEdwJDA=="
20
-#appsecret="94e944a69ad1d43ac447f5a8769ab801"
20
+appsecret="94e944a69ad1d43ac447f5a8769ab801"
21 21
 
22 22
 [test]
23 23
 redishost = kuyi6666.redis.rds.aliyuncs.com
@@ -38,5 +38,5 @@ writemysqlpass = 1Q2W3e4r!@#$
38 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 Прегледај датотеку

@@ -38,6 +38,10 @@ func ApiControllersRegisterRouters() {
38 38
 
39 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 47
 type BaseApiController struct {
@@ -172,13 +176,13 @@ func (c *BaseApiController) login(u models.XcxUser) (string, error) {
172 176
 	uJson, _ := json.Marshal(u)
173 177
 	redisCli := service.RedisClient()
174 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 181
 	claims := CustomClaims{
178 182
 		UserID: key,
179 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 Прегледај датотеку

@@ -0,0 +1,5 @@
1
+package controllers
2
+
3
+type CheckRecordApiController struct {
4
+	BaseApiAuthController
5
+}

+ 76 - 1
controllers/device_api_controllor.go Прегледај датотеку

@@ -1,5 +1,80 @@
1 1
 package controllers
2 2
 
3
+import "sws_xcx/service"
4
+
3 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 Прегледај датотеку

@@ -8,7 +8,7 @@ type SysDicApiController struct {
8 8
 
9 9
 // @Title GetIllness
10 10
 // @Description 获取病情字典
11
-// @Success 200 {object} models.type DicResp success
11
+// @Success 200 {array} models.DicResp success
12 12
 // @Failure 500 error
13 13
 // @router /getillness [get]
14 14
 func (c *SysDicApiController) GetIllness() {
@@ -24,7 +24,7 @@ func (c *SysDicApiController) GetIllness() {
24 24
 
25 25
 // @Title GetRenalStatus
26 26
 // @Description 获取肾功能情况列表
27
-// @Success 200 {object} models.type DicResp success
27
+// @Success 200 {array} models.DicResp success
28 28
 // @Failure 500 error
29 29
 // @router /getrenalstatus [get]
30 30
 func (c *SysDicApiController) GetRenalStatus() {
@@ -37,3 +37,34 @@ func (c *SysDicApiController) GetRenalStatus() {
37 37
 
38 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 Прегледај датотеку

@@ -4,22 +4,22 @@ import "time"
4 4
 
5 5
 //检测项目
6 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 25
 func (CheckItem) TableName() string {
@@ -28,20 +28,20 @@ func (CheckItem) TableName() string {
28 28
 
29 29
 //检测记录
30 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 47
 func (CheckRecord) TableName() string {
@@ -52,12 +52,12 @@ func (CheckRecord) TableName() string {
52 52
 type CheckRecordItem struct {
53 53
 	Id              int64     `json:"id" gorm:"type:bigint(20) auto_increment; NOT NULL; primary_key"`
54 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 58
 	Ctime           time.Time `json:"ctime" gorm:"type:datetime; DEFAULT: CURRENT_TIMESTAMP"`
59 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 63
 func (CheckRecordItem) TableName() string {
@@ -66,30 +66,30 @@ func (CheckRecordItem) TableName() string {
66 66
 
67 67
 //设备表
68 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 75
 	Mac                  string    `json:"mac" gorm:"type:varchar(255)"`
76 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 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 95
 func (Device) TableName() string {
@@ -103,8 +103,8 @@ type DeviceMessageLog struct {
103 103
 	DeviceName string    `json:"device_name" gorm:"type:varchar(255)"`
104 104
 	Topic      string    `json:"topic" gorm:"type:varchar(255)"`
105 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 110
 func (DeviceMessageLog) TableName() string {
@@ -113,13 +113,13 @@ func (DeviceMessageLog) TableName() string {
113 113
 
114 114
 //设备绑定表
115 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 125
 func (DeviceRelate) TableName() string {
@@ -133,7 +133,7 @@ type SysDictionary struct {
133 133
 	Type       string    `json:"type" gorm:"type:varchar(255)"`
134 134
 	ParentId   int       `json:"parent_id" gorm:"type:int(11)"`
135 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 139
 func (SysDictionary) TableName() string {
@@ -142,30 +142,30 @@ func (SysDictionary) TableName() string {
142 142
 
143 143
 //用户健康档案
144 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 171
 func (UserHealthProfile) TableName() string {
@@ -174,19 +174,19 @@ func (UserHealthProfile) TableName() string {
174 174
 
175 175
 //小程序用户表(个人中心)
176 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 191
 	SessionKey string `json:"session_key" gorm:"-"`
192 192
 }

+ 66 - 66
models/httpmodels.go Прегледај датотеку

@@ -12,86 +12,86 @@ type WxXcxLoginResp struct {
12 12
 }
13 13
 
14 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 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 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 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 93
 type DicResp struct {
94 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 Прегледај датотеку

@@ -0,0 +1,23 @@
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 Прегледај датотеку

@@ -0,0 +1,23 @@
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 Прегледај датотеку

@@ -0,0 +1,97 @@
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 Прегледај датотеку

@@ -9,7 +9,7 @@ import (
9 9
 
10 10
 type SysDicService struct {
11 11
 	rdb *gorm.DB
12
-	wdb *gorm.DB
12
+	//wdb *gorm.DB
13 13
 }
14 14
 
15 15
 func NewSysDicService() *SysDicService {
@@ -17,13 +17,13 @@ func NewSysDicService() *SysDicService {
17 17
 	return &SysDicService{
18 18
 
19 19
 		rdb: ReadDB().Model(dic),
20
-		wdb: WriteDB().Model(dic),
20
+		//wdb: WriteDB().Model(dic),
21 21
 	}
22 22
 }
23 23
 
24 24
 func (s *SysDicService) GetDicsByType(t string) ([]*models.SysDictionary, error) {
25 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 27
 	return dics, err
28 28
 }
29 29
 

+ 331 - 8
swagger/swagger.json Прегледај датотеку

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

+ 268 - 7
swagger/swagger.yml Прегледај датотеку

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