Kaynağa Gözat

Merge branch 'bzq1/mysteel_api' of eta_server/eta_index_lib into master

baoziqiang 1 hafta önce
ebeveyn
işleme
4295291ebb
2 değiştirilmiş dosya ile 14 ekleme ve 2 silme
  1. 12 2
      services/base_from_mysteel_chemical.go
  2. 2 0
      utils/config.go

+ 12 - 2
services/base_from_mysteel_chemical.go

@@ -553,7 +553,12 @@ func GetEdbDataFromMySteelChemical(indexCodes []string, startTime, endTime, orde
 		err = er
 		return
 	}
-	postUrl := `https://mds.mysteel.com/dynamic/order/api/fcAbRA`
+	// postUrl := `https://mds.mysteel.com/dynamic/order/api/fcAbRA`
+	postUrl := utils.MySteelChemicalApiUrl
+	if postUrl == "" {
+		err = errors.New("钢联化工接口url未配置")
+		return
+	}
 	body, err := MySteelChemicalPost(postUrl, "data", postData)
 	if err != nil {
 		return
@@ -605,7 +610,12 @@ func getPageIndexInfoMap(pageNum, pageSize int, includeInfo bool) (item *models.
 		err = er
 		return
 	}
-	postUrl := `https://mds.mysteel.com/dynamic/order/api/fcAbRA`
+	// postUrl := `https://mds.mysteel.com/dynamic/order/api/fcAbRA`
+	postUrl := utils.MySteelChemicalApiUrl
+	if postUrl == "" {
+		err = errors.New("钢联化工接口url未配置")
+		return
+	}
 	body, er := MySteelChemicalPost(postUrl, "info", postData)
 	if er != nil {
 		err = er

+ 2 - 0
utils/config.go

@@ -75,6 +75,7 @@ var (
 	ThsDataMethod           string //同花顺数据获取的方式,app是通过终端;api是通过接口
 	ThsRefreshToken         string // 同花顺的刷新token
 	MysteelChemicalApiToken string // 钢联化工的api数据token
+	MySteelChemicalApiUrl   string // 钢联化工的api数据地址
 )
 
 type WindUrlMap struct {
@@ -232,6 +233,7 @@ func init() {
 			ThsDataMethod = "api"
 		}
 		MysteelChemicalApiToken = config["mysteel_chemical_api_token"]
+		MySteelChemicalApiUrl = config["mysteel_chemical_api_url"]
 	}
 
 	// ES配置