|
@@ -6,7 +6,6 @@ import (
|
6
|
6
|
"Xcx_New/models"
|
7
|
7
|
"Xcx_New/service"
|
8
|
8
|
"Xcx_New/utils"
|
9
|
|
- "encoding/json"
|
10
|
9
|
"fmt"
|
11
|
10
|
"github.com/astaxie/beego"
|
12
|
11
|
"github.com/jinzhu/gorm"
|
|
@@ -27,7 +26,7 @@ func XcxApiControllersRegisterRouters() {
|
27
|
26
|
beego.Router("/xcx/api/mobile/patient", &XcxApiController{}, "Get:GetPatientList")
|
28
|
27
|
|
29
|
28
|
//获取登录后的信息
|
30
|
|
- beego.Router("/xcx/api/mobile/getdatainfo", &XcxApiController{}, "Post:GetDataInfo")
|
|
29
|
+ beego.Router("/xcx/api/mobile/getdatainfo", &XcxApiController{}, "Get:GetDataInfo")
|
31
|
30
|
|
32
|
31
|
//获取排班数据
|
33
|
32
|
beego.Router("/xcx/api/mobile/schedule", &XcxApiController{}, "Get:GetScheduleInfo")
|
|
@@ -202,23 +201,29 @@ func (this *XcxApiController) GetPatientList() {
|
202
|
201
|
}
|
203
|
202
|
|
204
|
203
|
func (this *XcxApiController) GetDataInfo() {
|
205
|
|
- dataBody := make(map[string]interface{}, 0)
|
206
|
|
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
207
|
|
- if err != nil {
|
208
|
|
- utils.ErrorLog(err.Error())
|
209
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
210
|
|
- return
|
211
|
|
- }
|
212
|
|
- appid, _ := dataBody["appid"].(string)
|
213
|
|
- key, _ := dataBody["key"].(string)
|
214
|
|
- iv, _ := dataBody["iv"].(string)
|
215
|
|
- encryptedData, _ := dataBody["encryptedData"].(string)
|
216
|
|
-
|
217
|
|
- list, err := service.DecryptData(appid, key, iv, encryptedData)
|
218
|
|
- if err == nil {
|
219
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
220
|
|
- return
|
221
|
|
- }
|
|
204
|
+ // dataBody := make(map[string]interface{}, 0)
|
|
205
|
+ // fmt.Println("dataBody",dataBody)
|
|
206
|
+ // err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
207
|
+ // if err != nil {
|
|
208
|
+ // utils.ErrorLog(err.Error())
|
|
209
|
+ // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
210
|
+ // return
|
|
211
|
+ // }
|
|
212
|
+ // fmt.Println(err)
|
|
213
|
+ // appid, _ := dataBody["appid"].(string)
|
|
214
|
+ // key, _ := dataBody["key"].(string)
|
|
215
|
+ // iv, _ := dataBody["iv"].(string)
|
|
216
|
+ // encryptedData, _ := dataBody["encryptedData"].(string)
|
|
217
|
+ appid := this.GetString("appid")
|
|
218
|
+ key := this.GetString("key")
|
|
219
|
+ iv := this.GetString("iv")
|
|
220
|
+ encryptedData := this.GetString("encryptedData")
|
|
221
|
+ list, _ := service.DecryptData(appid, key, iv, encryptedData)
|
|
222
|
+ fmt.Println(list)
|
|
223
|
+ // if err == nil {
|
|
224
|
+ // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
225
|
+ // return
|
|
226
|
+ // }
|
222
|
227
|
|
223
|
228
|
this.ServeSuccessJSON(map[string]interface{}{
|
224
|
229
|
"list": list,
|