浏览代码

加入引用的时间

xyxie 10 月之前
父节点
当前提交
9b4eda7c73
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      services/data/edb_info_relation.go

+ 4 - 0
services/data/edb_info_relation.go

@@ -5,6 +5,7 @@ import (
 	"eta/eta_api/services/alarm_msg"
 	"eta/eta_api/utils"
 	"fmt"
+	"time"
 )
 
 // SaveChartEdbInfoRelation 添加/编辑图表指标引用关联记录
@@ -53,6 +54,7 @@ func SaveChartEdbInfoRelation(edbInfoIds []int, chartInfo *data_manage.ChartInfo
 	}
 	// 新增不存在的引用关系
 	// 删除不再需要的引用关系
+	nowTime := time.Now()
 	addList := make([]*data_manage.EdbInfoRelation, 0)
 	deleteRelationIds := make([]int, 0)
 	for _, edbInfo := range edbInfoList {
@@ -70,6 +72,8 @@ func SaveChartEdbInfoRelation(edbInfoIds []int, chartInfo *data_manage.ChartInfo
 				EdbName:            edbInfo.EdbName,
 				Source:             edbInfo.Source,
 				EdbCode:            edbInfo.EdbCode,
+				CreateTime:         nowTime,
+				ModifyTime:         nowTime,
 			}
 			addList = append(addList, tmp)
 		}