hsun 8 月之前
父節點
當前提交
600d09875b
共有 1 個文件被更改,包括 9 次插入4 次删除
  1. 9 4
      models/pcsg/bloomberg.go

+ 9 - 4
models/pcsg/bloomberg.go

@@ -6,7 +6,7 @@ import (
 	"time"
 )
 
-// PythonBloombergGeneralData 通用数据格式
+// PythonBloombergGeneralData 通用数据格式(有空改成Map吧...然后做成配置方便加新字段...)
 type PythonBloombergGeneralData struct {
 	NAME                 string   `json:"NAME" description:"指标名称, 可能为null"`
 	IDENTIFIER           string   `json:"IDENTIFIER" description:"指标编码"`
@@ -16,9 +16,10 @@ type PythonBloombergGeneralData struct {
 	PX_VOLUME            *float64 `json:"PX_VOLUME" description:"数据值, 可能为null"`
 	LAST_UPDATE_DATE_EOD string   `json:"LAST_UPDATE_DATE_EOD" description:"数据日期, 可能为null"`
 	DATE                 string   `json:"DATE" description:"数据日期, 可能为null"`
-
-	PX_SETTLE         *float64 `json:"PX_SETTLE" description:"数据值, 可能为null"`
-	PX_SETTLE_LAST_DT string   `json:"PX_SETTLE_LAST_DT" description:"数据日期, 可能为null"`
+	PX_SETTLE            *float64 `json:"PX_SETTLE" description:"数据值, 可能为null"`
+	PX_SETTLE_LAST_DT    string   `json:"PX_SETTLE_LAST_DT" description:"数据日期, 可能为null"`
+	OPEN_INT             *float64 `json:"OPEN_INT"`
+	OPEN_INT_DATE        string   `json:"OPEN_INT_DATE"`
 }
 
 // PythonBloombergGeneralResult API响应体
@@ -80,6 +81,10 @@ func FormatPythonBloombergGeneralData2Base(origin PythonBloombergGeneralData, fr
 		dataTime, _ = time.ParseInLocation(utils.FormatDate, origin.PX_SETTLE_LAST_DT, time.Local)
 		val = origin.PX_SETTLE
 	}
+	if origin.OPEN_INT_DATE != "" && origin.OPEN_INT != nil {
+		dataTime, _ = time.ParseInLocation(utils.FormatDate, origin.OPEN_INT_DATE, time.Local)
+		val = origin.OPEN_INT
+	}
 	if !dataTime.IsZero() && val != nil {
 		item.Data = append(item.Data, BaseFromBloombergApiIndexData{
 			DataTime: dataTime,