12345678910111213141516171819202122232425262728 |
- package excel
- import (
- excel2 "eta/eta_api/models/data_manage/excel"
- "eta/eta_api/services/elastic"
- "eta/eta_api/utils"
- "fmt"
- "strconv"
- )
- // EsAddOrEditExcel 新增和修改ES中的表格
- func EsAddOrEditExcel(excelId int) {
- var err error
- defer func() {
- if err != nil {
- tips := fmt.Sprintf("EsAddOrEditExcel, excelId: %d, err: %v", excelId, err)
- utils.FileLog.Info(tips)
- }
- }()
- item, e := excel2.GetExcelInfoById(excelId)
- if e != nil {
- err = fmt.Errorf("获取表格失败, %v", e)
- return
- }
- item.Content = "" // 内容没必要写进去
- err = elastic.EsAddOrEditExcelInfoData(utils.EsExcelIndexName, strconv.Itoa(excelId), item)
- return
- }
|