|
@@ -1,6 +1,7 @@
|
|
|
package logic
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
"hongze/hongze_edb_lib/models"
|
|
|
"hongze/hongze_edb_lib/services/elastic"
|
|
|
"hongze/hongze_edb_lib/utils"
|
|
@@ -13,3 +14,13 @@ func UpdateEs(edbInfoId int) {
|
|
|
itemInfo, _ := models.GetEdbInfoItemByCondition("AND edb_info_id=?", []interface{}{edbInfoId})
|
|
|
elastic.EsAddOrEditEdbInfoData(utils.DATA_INDEX_NAME, strconv.Itoa(itemInfo.EdbInfoId), itemInfo)
|
|
|
}
|
|
|
+
|
|
|
+// UpdateAllEdbInfoEs 更新所有的指标ES的信息
|
|
|
+func UpdateAllEdbInfoEs() {
|
|
|
+ //添加es
|
|
|
+ list, _ := models.GetEdbInfoItemListByCondition()
|
|
|
+ for _, itemInfo := range list {
|
|
|
+ elastic.EsAddOrEditEdbInfoData(utils.DATA_INDEX_NAME, strconv.Itoa(itemInfo.EdbInfoId), itemInfo)
|
|
|
+ }
|
|
|
+ fmt.Println("修复完成")
|
|
|
+}
|