...
|
...
|
@@ -14,16 +14,20 @@ type PlatformController struct { |
|
|
|
|
|
//
|
|
|
func (c PlatformController) UpdateData() {
|
|
|
var respMsg = map[string]interface{}{
|
|
|
"code": 0,
|
|
|
"msg": "ok",
|
|
|
}
|
|
|
defer func() {
|
|
|
c.Data["json"] = map[string]interface{}{
|
|
|
"code": 0,
|
|
|
"msg": "ok",
|
|
|
}
|
|
|
c.Data["json"] = respMsg
|
|
|
c.ServeJSON()
|
|
|
}()
|
|
|
|
|
|
var param platform.CommonProtocol
|
|
|
if err := json.Unmarshal(c.Ctx.Input.RequestBody, ¶m); err != nil {
|
|
|
log.Error("json 解析失败 err:%s", err)
|
|
|
respMsg["code"] = -1
|
|
|
respMsg["msg"] = "json 解析失败 err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
m, err := platform.NewPlatformAction(param.Module)
|
...
|
...
|
@@ -34,12 +38,17 @@ func (c PlatformController) UpdateData() { |
|
|
bt, err := json.Marshal(param.Data)
|
|
|
if err != nil {
|
|
|
log.Error("解析param.data数据失败")
|
|
|
respMsg["code"] = -1
|
|
|
respMsg["msg"] = "json 解析失败 err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
err = m.DoAction(param.Action, bt)
|
|
|
if err != nil {
|
|
|
log.Error("同步数据发生错误,module=%s,action=%s,err:%s", param.Module, param.Action, err)
|
|
|
respMsg["code"] = -1
|
|
|
respMsg["msg"] = fmt.Sprintf("同步数据发生错误,module=%s,action=%s,err:%s", param.Module, param.Action, err)
|
|
|
return
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
func (c PlatformController) CompanyAdminChance() {
|
...
|
...
|
|