正在显示
1 个修改的文件
包含
6 行增加
和
4 行删除
| @@ -14,14 +14,16 @@ type PlatformController struct { | @@ -14,14 +14,16 @@ type PlatformController struct { | ||
| 14 | 14 | ||
| 15 | // | 15 | // |
| 16 | func (c PlatformController) UpdateData() { | 16 | func (c PlatformController) UpdateData() { |
| 17 | - var msg *protocol.ResponseMessage | ||
| 18 | defer func() { | 17 | defer func() { |
| 19 | - c.ResposeJson(msg) | 18 | + c.Data["json"] = map[string]interface{}{ |
| 19 | + "code": 0, | ||
| 20 | + "msg": "ok", | ||
| 21 | + } | ||
| 22 | + c.ServeJSON() | ||
| 20 | }() | 23 | }() |
| 21 | var param platform.CommonProtocol | 24 | var param platform.CommonProtocol |
| 22 | if err := json.Unmarshal(c.Ctx.Input.RequestBody, ¶m); err != nil { | 25 | if err := json.Unmarshal(c.Ctx.Input.RequestBody, ¶m); err != nil { |
| 23 | log.Error("json 解析失败 err:%s", err) | 26 | log.Error("json 解析失败 err:%s", err) |
| 24 | - msg = protocol.BadRequestParam("1") | ||
| 25 | return | 27 | return |
| 26 | } | 28 | } |
| 27 | // m, err := platform.NewPlatformAction(param.Module) | 29 | // m, err := platform.NewPlatformAction(param.Module) |
| @@ -30,7 +32,7 @@ func (c PlatformController) UpdateData() { | @@ -30,7 +32,7 @@ func (c PlatformController) UpdateData() { | ||
| 30 | // return | 32 | // return |
| 31 | // } | 33 | // } |
| 32 | // err = m.DoAction(param.Action, []byte(param.Data)) | 34 | // err = m.DoAction(param.Action, []byte(param.Data)) |
| 33 | - msg = protocol.NewMessage("0") | 35 | + |
| 34 | return | 36 | return |
| 35 | } | 37 | } |
| 36 | 38 |
-
请 注册 或 登录 后发表评论