Browse Source

Merge branch 'feature/eta_1.9.3' into debug

hsun 8 months ago
parent
commit
6320e08d92
3 changed files with 16 additions and 11 deletions
  1. 6 4
      models/edb_data_base.go
  2. 7 5
      services/data/base_edb_lib.go
  3. 3 2
      utils/constants.go

+ 6 - 4
models/edb_data_base.go

@@ -8,11 +8,13 @@ import (
 func GetEdbDataTableName(source, subSource int) (tableName string) {
 	switch source {
 	case utils.DATA_SOURCE_THS:
-		tableName = "edb_data_ths"
-		if subSource == utils.DATA_SUB_SOURCE_EDB {
-			tableName = "edb_data_ths"
-		} else {
+		switch subSource {
+		case utils.DATA_SUB_SOURCE_DATE:
 			tableName = "edb_data_ths_ds"
+		case utils.DATA_SUB_SOURCE_HIGH_FREQUENCY:
+			tableName = "edb_data_ths_hf"
+		default:
+			tableName = "edb_data_ths"
 		}
 	case utils.DATA_SOURCE_WIND:
 		if subSource == utils.DATA_SUB_SOURCE_EDB {

+ 7 - 5
services/data/base_edb_lib.go

@@ -75,11 +75,13 @@ func RefreshEdbData(edbInfoId, source, subSource int, edbCode, startDate string)
 	urlStr := ``
 	switch source {
 	case utils.DATA_SOURCE_THS:
-		urlStr = "ths/refresh"
-		if subSource == 0 {
-			urlStr = "ths/refresh"
-		} else {
+		switch subSource {
+		case utils.DATA_SUB_SOURCE_DATE:
 			urlStr = "ths/ds/refresh"
+		case utils.DATA_SUB_SOURCE_HIGH_FREQUENCY:
+			urlStr = "ths/hf/edb/refresh"
+		default:
+			urlStr = "ths/refresh"
 		}
 	case utils.DATA_SOURCE_WIND:
 		if subSource == 0 {
@@ -137,7 +139,7 @@ func RefreshEdbData(edbInfoId, source, subSource int, edbCode, startDate string)
 		urlStr = "gz/refresh"
 	case utils.DATA_SOURCE_ICPI:
 		urlStr = "icpi/refresh"
-		case utils.DATA_SOURCE_SCI99:
+	case utils.DATA_SOURCE_SCI99:
 		urlStr = "sci99/refresh"
 	default:
 		edbSource := data_manage.EdbSourceIdMap[source]

+ 3 - 2
utils/constants.go

@@ -210,8 +210,9 @@ var DataSourceEnMap = map[int]string{
 
 // 子数据来源渠道
 const (
-	DATA_SUB_SOURCE_EDB  = iota //经济数据库
-	DATA_SUB_SOURCE_DATE        //日期序列
+	DATA_SUB_SOURCE_EDB            = iota //经济数据库
+	DATA_SUB_SOURCE_DATE                  //日期序列
+	DATA_SUB_SOURCE_HIGH_FREQUENCY        //高频数据
 )
 
 const (