package xiangyu import ( "eta/eta_bridge/controller/resp" "eta/eta_bridge/global" "eta/eta_bridge/logic/xiangyu" "eta/eta_bridge/models/index" xiangyuSrc "eta/eta_bridge/services/xiangyu" "github.com/gin-gonic/gin" "github.com/go-playground/validator/v10" ) // GetCrmData // @Description: 获取crm数据 // @author: Roc // @receiver xc // @datetime 2024-5-14 13:09:30 // @param c *gin.Context func (xc *XiangyuController) GetCrmData(c *gin.Context) { var req index.GetBusinessDataReq 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 } if req.IndexCode == `` && req.IndexPkgCode == `` { resp.Fail("指标编码或者指标包编码不允许为空", c) } //if req.Partition == `` { // resp.Fail("数据分区参数不允许为空", c) //} xyReq := xiangyuSrc.PostGetIndexDataParamReq{ PageNum: req.CurrentIndex, PageSize: req.PageSize, AssetCd: req.IndexCode, AssetPkgCd: req.IndexPkgCode, DataDt: "", StartDt: "", EndDt: "", Sort: "", DataSourceType: req.DataSourceType, InfoLastUpdateStartTime: req.InfoLastUpdateStartTime, InfoLastUpdateEndTime: req.InfoLastUpdateEndTime, DetailLastUpdateStartTime: req.DetailLastUpdateStartTime, DetailLastUpdateEndTime: req.DetailLastUpdateEndTime, } dataResp, err, errMsg := xiangyu.PostGetIndexData(xyReq) if err != nil { resp.FailData(errMsg, err.Error(), c) return } resp.OkData("同步成功", dataResp, c) return }