feat: 配置修改推入kafka
This commit is contained in:
@@ -2,22 +2,26 @@ package service
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"nms_cxy/lib/core/utils/date"
|
||||||
"nms_cxy/src/framework/constants/uploadsubpath"
|
"nms_cxy/src/framework/constants/uploadsubpath"
|
||||||
"nms_cxy/src/framework/logger"
|
"nms_cxy/src/framework/logger"
|
||||||
"nms_cxy/src/framework/utils/cmd"
|
"nms_cxy/src/framework/utils/cmd"
|
||||||
"nms_cxy/src/framework/utils/file"
|
"nms_cxy/src/framework/utils/file"
|
||||||
|
"nms_cxy/src/framework/utils/generate"
|
||||||
"nms_cxy/src/framework/utils/ssh"
|
"nms_cxy/src/framework/utils/ssh"
|
||||||
neModel "nms_cxy/src/modules/network_element/model"
|
neModel "nms_cxy/src/modules/network_element/model"
|
||||||
neService "nms_cxy/src/modules/network_element/service"
|
neService "nms_cxy/src/modules/network_element/service"
|
||||||
"nms_cxy/src/modules/nms_cxy/utils/common"
|
"nms_cxy/src/modules/nms_cxy/utils/common"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 实例化数据层 ConfigImpl 结构体
|
// 实例化数据层 ConfigImpl 结构体
|
||||||
var NewConfigImpl = &ConfigImpl{
|
var NewConfigImpl = &ConfigImpl{
|
||||||
neInfoService: neService.NewNeInfoImpl,
|
neInfoService: neService.NewNeInfoImpl,
|
||||||
neVersionService: neService.NewNeVersionImpl,
|
neVersionService: neService.NewNeVersionImpl,
|
||||||
|
resourceService: NewResourceImpl,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 配置数据处理服务 服务层处理
|
// 配置数据处理服务 服务层处理
|
||||||
@@ -26,6 +30,8 @@ type ConfigImpl struct {
|
|||||||
neInfoService neService.INeInfo
|
neInfoService neService.INeInfo
|
||||||
// 网元版本信息服务
|
// 网元版本信息服务
|
||||||
neVersionService neService.INeVersion
|
neVersionService neService.INeVersion
|
||||||
|
// 资源数据处理服务
|
||||||
|
resourceService IResource
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConfigUploadOSS 配置数据上报
|
// ConfigUploadOSS 配置数据上报
|
||||||
@@ -438,6 +444,14 @@ func (s *ConfigImpl) ConfigParamModify(neInfo neModel.NeInfo, operType string, o
|
|||||||
// 新增
|
// 新增
|
||||||
// if operType == "add" {}
|
// if operType == "add" {}
|
||||||
|
|
||||||
|
// 操作记录推送 Kafka
|
||||||
|
pushData := operPara
|
||||||
|
pushData["MsgID"] = generate.Code(9)
|
||||||
|
pushData["Ruid"] = neInfo.RmUID
|
||||||
|
pushData["ChangeTime"] = date.ParseDateToStr(time.Now(), date.YYYY_MM_DD_HH_MM_SS)
|
||||||
|
pushData["ChangeType"] = operType
|
||||||
|
s.resourceService.KafkaPush(neInfo.NeType, "", pushData)
|
||||||
|
|
||||||
return failPara
|
return failPara
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user