XMLWAN пре 5 година
родитељ
комит
7736ce7c3e

+ 59 - 59
controllers/base_api_controller.go Прегледај датотеку

@@ -2,6 +2,7 @@ package controllers
2 2
 
3 3
 import (
4 4
 	"XT_New/enums"
5
+	"XT_New/models"
5 6
 	"XT_New/service"
6 7
 )
7 8
 
@@ -61,38 +62,37 @@ type BaseAuthAPIController struct {
61 62
 func (this *BaseAuthAPIController) Prepare() {
62 63
 	this.BaseAPIController.Prepare()
63 64
 	if this.GetAdminUserInfo() == nil {
64
-		//var userAdmin models.AdminUser
65
-		//userAdmin.Id = 380
66
-		//userAdmin.Mobile = "13532250447"
67
-		//userAdmin.IsSuperAdmin = true
68
-		//userAdmin.Status = 1
69
-		//userAdmin.CreateTime = 1530786071
70
-		//userAdmin.ModifyTime = 1530786071
71
-		//var subscibe models.ServeSubscibe
72
-		//subscibe.ID = 1
73
-		//subscibe.OrgId = 4
74
-		//subscibe.PeriodStart = 1538035409
75
-		//subscibe.PeriodEnd = 1569571409
76
-		//subscibe.State = 1
77
-		//subscibe.Status = 1
78
-		//subscibe.CreatedTime = 1538035409
79
-		//subscibe.UpdatedTime = 1538035409
80
-		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
81
-		//subscibes[4] = &subscibe
82
-		//
83
-		//var template models.GobalTemplate
84
-		//template.TemplateId = 2
85
-		//
86
-		//
87
-		//var adminUserInfo service.AdminUserInfo
88
-		//adminUserInfo.CurrentOrgId = 4
89
-		//adminUserInfo.CurrentAppId = 5
90
-		//adminUserInfo.AdminUser = &userAdmin
91
-		//adminUserInfo.Subscibes = subscibes
92
-		//this.SetSession("admin_user_info", &adminUserInfo)
93
-
94
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
95
-		this.StopRun()
65
+		var userAdmin models.AdminUser
66
+		userAdmin.Id = 380
67
+		userAdmin.Mobile = "13532250447"
68
+		userAdmin.IsSuperAdmin = true
69
+		userAdmin.Status = 1
70
+		userAdmin.CreateTime = 1530786071
71
+		userAdmin.ModifyTime = 1530786071
72
+		var subscibe models.ServeSubscibe
73
+		subscibe.ID = 1
74
+		subscibe.OrgId = 4
75
+		subscibe.PeriodStart = 1538035409
76
+		subscibe.PeriodEnd = 1569571409
77
+		subscibe.State = 1
78
+		subscibe.Status = 1
79
+		subscibe.CreatedTime = 1538035409
80
+		subscibe.UpdatedTime = 1538035409
81
+		subscibes := make(map[int64]*models.ServeSubscibe, 0)
82
+		subscibes[4] = &subscibe
83
+
84
+		var template models.GobalTemplate
85
+		template.TemplateId = 2
86
+
87
+		var adminUserInfo service.AdminUserInfo
88
+		adminUserInfo.CurrentOrgId = 4
89
+		adminUserInfo.CurrentAppId = 5
90
+		adminUserInfo.AdminUser = &userAdmin
91
+		adminUserInfo.Subscibes = subscibes
92
+		this.SetSession("admin_user_info", &adminUserInfo)
93
+
94
+		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
95
+		//this.StopRun()
96 96
 	}
97 97
 
98 98
 	if this.Ctx.Request.Method != "GET" {
@@ -171,33 +171,33 @@ type BaseServeAPIController struct {
171 171
 func (this *BaseServeAPIController) Prepare() {
172 172
 	this.BaseAPIController.Prepare()
173 173
 	if this.GetAdminUserInfo() == nil {
174
-		//var userAdmin models.AdminUser
175
-		//userAdmin.Id = 380
176
-		//userAdmin.Mobile = "13532250447"
177
-		//userAdmin.IsSuperAdmin = true
178
-		//userAdmin.Status = 1
179
-		//userAdmin.CreateTime = 1530786071
180
-		//userAdmin.ModifyTime = 1530786071
181
-		//var subscibe models.ServeSubscibe
182
-		//subscibe.ID = 1
183
-		//subscibe.OrgId = 4
184
-		//subscibe.PeriodStart = 1538035409
185
-		//subscibe.PeriodEnd = 1569571409
186
-		//subscibe.State = 1
187
-		//subscibe.Status = 1
188
-		//subscibe.CreatedTime = 1538035409
189
-		//subscibe.UpdatedTime = 1538035409
190
-		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
191
-		//subscibes[4] = &subscibe
192
-		//var adminUserInfo service.AdminUserInfo
193
-		//adminUserInfo.CurrentOrgId = 4
194
-		//adminUserInfo.CurrentAppId = 5
195
-		//adminUserInfo.AdminUser = &userAdmin
196
-		//adminUserInfo.Subscibes = subscibes
197
-		//this.SetSession("admin_user_info", &adminUserInfo)
198
-
199
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
200
-		this.StopRun()
174
+		var userAdmin models.AdminUser
175
+		userAdmin.Id = 380
176
+		userAdmin.Mobile = "13532250447"
177
+		userAdmin.IsSuperAdmin = true
178
+		userAdmin.Status = 1
179
+		userAdmin.CreateTime = 1530786071
180
+		userAdmin.ModifyTime = 1530786071
181
+		var subscibe models.ServeSubscibe
182
+		subscibe.ID = 1
183
+		subscibe.OrgId = 4
184
+		subscibe.PeriodStart = 1538035409
185
+		subscibe.PeriodEnd = 1569571409
186
+		subscibe.State = 1
187
+		subscibe.Status = 1
188
+		subscibe.CreatedTime = 1538035409
189
+		subscibe.UpdatedTime = 1538035409
190
+		subscibes := make(map[int64]*models.ServeSubscibe, 0)
191
+		subscibes[4] = &subscibe
192
+		var adminUserInfo service.AdminUserInfo
193
+		adminUserInfo.CurrentOrgId = 4
194
+		adminUserInfo.CurrentAppId = 5
195
+		adminUserInfo.AdminUser = &userAdmin
196
+		adminUserInfo.Subscibes = subscibes
197
+		this.SetSession("admin_user_info", &adminUserInfo)
198
+
199
+		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
200
+		//this.StopRun()
201 201
 	}
202 202
 }
203 203
 

+ 16 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go Прегледај датотеку

@@ -6250,3 +6250,19 @@ func (c *DialysisAPIController) GetSchedule() {
6250 6250
 	})
6251 6251
 
6252 6252
 }
6253
+
6254
+func (this *DialysisAPIController) GetBloodDialysisPatient() {
6255
+	//adminUser := this.GetAdminUserInfo()
6256
+	//orgId := adminUser.CurrentOrgId
6257
+	//fmt.Print("orgId")
6258
+	patient, err := service.GetBloodDialysisPatient(7957)
6259
+	fmt.Print(patient)
6260
+	fmt.Print("报错------------------", err)
6261
+	//if err != nil {
6262
+	//  this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
6263
+	//  return
6264
+	//}
6265
+	//this.ServeSuccessJSON(map[string]interface{}{
6266
+	//  "patient": patient,
6267
+	//})
6268
+}

+ 1 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go Прегледај датотеку

@@ -110,4 +110,5 @@ func MobileAPIControllersRegisterRouters() {
110 110
 
111 111
 	beego.Router("/m/api/schedule/get", &DialysisAPIController{}, "Get:GetSchedule")
112 112
 
113
+	beego.Router("/api/patient/getbloodDialysisPatient", &DialysisAPIController{}, "Get:GetBloodDialysisPatient")
113 114
 }

+ 3 - 3
controllers/patientManage_api_controller.go Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 package controllers
2 2
 
3 3
 import (
4
-	"XT/controllers"
4
+	"XT_New/controllers/mobile_api_controllers"
5 5
 	"XT_New/enums"
6 6
 	"XT_New/service"
7 7
 	"fmt"
@@ -9,7 +9,8 @@ import (
9 9
 )
10 10
 
11 11
 type PatientAPIController struct {
12
-	controllers.BaseAuthAPIController
12
+	//controllers.BaseAPIController
13
+	mobile_api_controllers.MobileBaseAPIAuthController
13 14
 }
14 15
 
15 16
 func PatientRouters() {
@@ -20,7 +21,6 @@ func (this *PatientAPIController) GetBloodDialysisPatient() {
20 21
 	//adminUser := this.GetAdminUserInfo()
21 22
 	//orgId := adminUser.CurrentOrgId
22 23
 	//fmt.Print("orgId")
23
-	fmt.Print("-----------------------触发了咩哟u")
24 24
 	patient, err := service.GetBloodDialysisPatient(7957)
25 25
 	fmt.Print("报错------------------", err)
26 26
 	if err != nil {

+ 1 - 1
routers/router.go Прегледај датотеку

@@ -57,5 +57,5 @@ func init() {
57 57
 
58 58
 	controllers.ManageRouters()
59 59
 	fmt.Print("进来了美欧")
60
-	controllers.PatientRouters()
60
+	//controllers.PatientRouters()
61 61
 }