package xiangyu import ( "eta/eta_bridge/controller/resp" "eta/eta_bridge/global" "eta/eta_bridge/logic/xiangyu" xiangyuSrc "eta/eta_bridge/services/xiangyu" "github.com/gin-gonic/gin" "github.com/go-playground/validator/v10" ) // PushData // @Description: 数据推送 // @author: Roc // @receiver xc // @datetime 2024-02-27 17:53:24 // @param c *gin.Context func (xc *XiangyuController) PushData(c *gin.Context) { var req xiangyuSrc.PushDataParamReq if e := c.Bind(&req); e != nil { err, ok := e.(validator.ValidationErrors) if !ok { resp.FailData("参数解析失败", "Err:"+e.Error(), c) return } resp.FailData("参数解析失败", err.Translate(global.Trans), c) return } err, errMsg := xiangyu.PushData(req) if err != nil { resp.FailData(errMsg, err.Error(), c) return } resp.OkData("同步成功", "", c) return }