Browse Source

Merge branch 'feature/pool255_future_good' into debug

xyxie 6 months ago
parent
commit
b4832300ab
2 changed files with 29 additions and 4 deletions
  1. 23 0
      controller/chart/chart_common.go
  2. 6 4
      models/request/chart.go

+ 23 - 0
controller/chart/chart_common.go

@@ -230,6 +230,29 @@ func getFutureGoodChartInfoDetail(chartInfo *chartInfoModel.ChartInfoView, myCha
 				}
 			}
 		}
+		if v.Source == 0 {
+			name := strings.Split(v.EdbName, "(")
+			if barConfig.FutureGoodEdbName != "" {
+				name[0] = barConfig.FutureGoodEdbName
+			}
+			v.EdbName = name[0]
+			if len(name) > 1 {
+				v.EdbName = v.EdbName + "(" + name[1]
+			}
+			//英文
+			// 编译正则表达式,匹配一个或多个数字
+
+			if v.EdbNameEn != "" {
+				name = strings.Split(v.EdbNameEn, "(")
+				if barConfig.FutureGoodEdbNameEn != "" {
+					name[0] = barConfig.FutureGoodEdbNameEn
+				}
+				v.EdbNameEn = name[0]
+				if len(name) > 1 {
+					v.EdbNameEn = v.EdbNameEn + "(" + name[1]
+				}
+			}
+		}
 	}
 	baseEdbInfo := baseEdbInfoMapping //现货指标
 	chartInfo.UnitEn = baseEdbInfo.UnitEn

+ 6 - 4
models/request/chart.go

@@ -10,10 +10,12 @@ type BarChartInfoReq struct {
 }
 
 type FutureGoodBarChartInfoReq struct {
-	EdbInfoIdList []BarChartInfoEdbItemReq `description:"指标信息"`
-	DateList      []BarChartInfoDateReq    `description:"日期配置"`
-	XDataList     []XData                  `description:"横轴配置"`
-	BaseEdbInfoId int                      `description:"日期基准指标id"`
+	EdbInfoIdList       []BarChartInfoEdbItemReq `description:"指标信息"`
+	DateList            []BarChartInfoDateReq    `description:"日期配置"`
+	XDataList           []XData                  `description:"横轴配置"`
+	BaseEdbInfoId       int                      `description:"日期基准指标id"`
+	FutureGoodEdbName   string                   `description:"期货名称"`
+	FutureGoodEdbNameEn string                   `description:"期货英文名称"`
 }
 
 // XData 商品价格曲线的的x轴数据