1234567891011121314151617181920212223242526 |
- package logic
- import (
- "eta/eta_index_lib/models"
- "eta/eta_index_lib/services/elastic"
- "eta/eta_index_lib/utils"
- "fmt"
- "strconv"
- )
- // UpdateEs 更新ES的指标数据
- func UpdateEs(edbInfoId int) {
- //添加es
- 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("修复完成")
- }
|