Browse Source

提交代码

XMLWAN 5 years ago
parent
commit
7736ce7c3e

+ 59 - 59
controllers/base_api_controller.go View File

2
 
2
 
3
 import (
3
 import (
4
 	"XT_New/enums"
4
 	"XT_New/enums"
5
+	"XT_New/models"
5
 	"XT_New/service"
6
 	"XT_New/service"
6
 )
7
 )
7
 
8
 
61
 func (this *BaseAuthAPIController) Prepare() {
62
 func (this *BaseAuthAPIController) Prepare() {
62
 	this.BaseAPIController.Prepare()
63
 	this.BaseAPIController.Prepare()
63
 	if this.GetAdminUserInfo() == nil {
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
 	if this.Ctx.Request.Method != "GET" {
98
 	if this.Ctx.Request.Method != "GET" {
171
 func (this *BaseServeAPIController) Prepare() {
171
 func (this *BaseServeAPIController) Prepare() {
172
 	this.BaseAPIController.Prepare()
172
 	this.BaseAPIController.Prepare()
173
 	if this.GetAdminUserInfo() == nil {
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 View File

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 View File

110
 
110
 
111
 	beego.Router("/m/api/schedule/get", &DialysisAPIController{}, "Get:GetSchedule")
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 View File

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

+ 1 - 1
routers/router.go View File

57
 
57
 
58
 	controllers.ManageRouters()
58
 	controllers.ManageRouters()
59
 	fmt.Print("进来了美欧")
59
 	fmt.Print("进来了美欧")
60
-	controllers.PatientRouters()
60
+	//controllers.PatientRouters()
61
 }
61
 }