|
@@ -269,8 +269,12 @@ func GetIndexCreate() (items []index.BaseFromMysteelChemicalIndex, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+type IndexRefreshReq struct {
|
|
|
+ Frequency string
|
|
|
+}
|
|
|
+
|
|
|
// GetIndexRefreshAllByMergeFile 获取全部刷新所需文件
|
|
|
-func GetIndexRefreshAllByMergeFile() (items []index.BaseFromMysteelChemicalIndex, err error) {
|
|
|
+func GetIndexRefreshAllByMergeFile(frequency string) (items []index.BaseFromMysteelChemicalIndex, err error) {
|
|
|
if global.CONFIG.Serve.EdbLibUrl == `` {
|
|
|
err = errors.New("刷新未配置")
|
|
|
return
|
|
@@ -278,7 +282,16 @@ func GetIndexRefreshAllByMergeFile() (items []index.BaseFromMysteelChemicalIndex
|
|
|
|
|
|
baseUrl := "/mysteel_chemical/query/refresh"
|
|
|
url := fmt.Sprint(global.CONFIG.Serve.EdbLibUrl, baseUrl)
|
|
|
- result, err := HttpPost(url, "", "application/json")
|
|
|
+
|
|
|
+ req := new(IndexRefreshReq)
|
|
|
+ req.Frequency = frequency
|
|
|
+
|
|
|
+ postData, err := json.Marshal(req)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ result, err := HttpPost(url, string(postData), "application/json")
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|