feat: 网元参数配置数据变更日志

This commit is contained in:
TsMask
2024-07-02 10:53:55 +08:00
parent bebc24ac23
commit 078edd2a6a
10 changed files with 504 additions and 34 deletions

View File

@@ -65,7 +65,7 @@ func (r *PtNeConfigDataService) DeleteByIds(paramIds []string) (int64, error) {
// 检查是否存在
ids := r.ptNeConfigDataRepository.SelectByIds(paramIds)
if len(ids) <= 0 {
return 0, fmt.Errorf("neHostCmd.noData")
return 0, fmt.Errorf("ptNeConfigData.noData")
}
if len(ids) == len(paramIds) {
@@ -94,7 +94,11 @@ func (r *PtNeConfigDataService) SaveAsDefaultByType(neInfo neModel.NeInfo, stubT
continue
}
// 将json数据转字符串存储 data:[{},{}]
paramDataByte, err := json.Marshal(resData)
dataArr, ok := resData["data"]
if !ok {
continue
}
paramDataByte, err := json.Marshal(dataArr)
if err != nil {
continue
}
@@ -138,7 +142,7 @@ func (r *PtNeConfigDataService) SelectByStubType(param model.PtNeConfigData) mod
if len(list) > 0 {
paraData = list[0]
if err := json.Unmarshal([]byte(paraData.ParamJson), &paraData.ParamData); err != nil {
paraData.ParamData = map[string]any{}
paraData.ParamData = []map[string]any{}
}
}
return paraData