zwxi 8 months ago
parent
commit
ae81d5f90c
1 changed files with 0 additions and 59 deletions
  1. 0 59
      controllers/data_manage/chart_info.go

+ 0 - 59
controllers/data_manage/chart_info.go

@@ -4429,62 +4429,3 @@ func (this *ChartInfoController) PreviewSeasonChartInfo() {
 	br.Msg = "获取成功"
 	br.Data = resp
 }
-
-// ChartInfoImgSetBySvg
-// @Title 图表图片上传
-// @Param   Img   query   string  true       "图片"
-// @Param   ChartInfoId   query   int  true       "图表ID"
-// @Success 200 {object} models.ResourceResp
-// @router /chart_info/image/set_by_svg [post]
-func (this *ChartInfoController) ChartInfoImgSetBySvg() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		this.Data["json"] = br
-		this.ServeJSON()
-	}()
-	imgData := this.GetString("Img")
-	if imgData == "" {
-		br.Msg = "图片参数错误"
-		br.ErrMsg = "图片参数错误,Img Is Empty"
-		return
-	}
-	chartInfoId, _ := this.GetInt("ChartInfoId", 0)
-	if chartInfoId <= 0 {
-		br.Msg = "图片参数错误"
-		br.ErrMsg = "图片参数错误,ChartInfoId Is Empty"
-		return
-	}
-	resp := new(models.ResourceResp)
-
-	// 通过svg图片生成图片资源地址
-	resourceUrl, err, errMsg := services.GetResourceUrlBySvgImg(imgData)
-	if err != nil {
-		br.Msg = errMsg
-		br.ErrMsg = err.Error()
-		return
-	}
-
-	// 修改图表的缩略图信息
-	if chartInfoId > 0 && resourceUrl != "" {
-		err = data_manage.EditChartInfoImageV2(chartInfoId, resourceUrl)
-		if err != nil {
-			br.Msg = "保存失败"
-			br.ErrMsg = "保存失败,Err:" + err.Error()
-			return
-		}
-
-		//修改es数据
-		go data.EsAddOrEditChartInfo(chartInfoId)
-		//修改my eta es数据
-		go data.EsAddOrEditMyChartInfoByChartInfoId(chartInfoId)
-	}
-
-	resp.ResourceUrl = resourceUrl
-	resp.Source = "convert"
-	//resp.CacheKey = imgDataKey
-	br.Msg = "上传成功"
-	br.Ret = 200
-	br.Success = true
-	br.Data = resp
-	return
-}