package controllers import ( "encoding/json" "eta/eta_data_push/models" ) // 计算指标 type EdbInfoCalculateController struct { BaseAuthController } // @Title 获取计算指标信息映射信息 // @Description 获取计算指标信息映射信息 // @Param request body models.EdbInfoCalculateItemReq true "type json string" // @Success 200 {object} models.EdbInfoCalculateMapping // @router /item [post] func (this *EdbInfoCalculateController) EdbInfoCalculateItem() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() var req models.EdbInfoCalculateItemReq err := json.Unmarshal(this.Ctx.Input.RequestBody, &req) if err != nil { br.Msg = "参数解析异常!" br.ErrMsg = "参数解析失败,Err:" + err.Error() return } if req.EdbCode == "" { br.Msg = "请输入指标编码!" return } items, err := models.GetEdbInfoCalculateMappingByEdbCode(req.EdbCode) if err != nil { br.Msg = "获取数据失败!" br.ErrMsg = "获取数据失败,Err:" + err.Error() return } br.Ret = 200 br.Success = true br.Msg = "获取成功" br.Data = items }