fix: 网元主机title唯一导致冲突5002修改失败
This commit is contained in:
@@ -257,7 +257,7 @@ func (r NeInfo) Insert(neInfo model.NeInfo) int64 {
|
|||||||
uuid := generate.Code(4)
|
uuid := generate.Code(4)
|
||||||
var hostIDs []string
|
var hostIDs []string
|
||||||
for _, host := range neInfo.Hosts {
|
for _, host := range neInfo.Hosts {
|
||||||
host.Title = neInfo.NeName + "_" + uuid
|
host.Title = fmt.Sprintf("%s_%d_%s", neInfo.NeName, host.Port, uuid)
|
||||||
host.GroupID = "1"
|
host.GroupID = "1"
|
||||||
host.CreateBy = neInfo.CreateBy
|
host.CreateBy = neInfo.CreateBy
|
||||||
hostId := r.neHostService.Insert(host)
|
hostId := r.neHostService.Insert(host)
|
||||||
@@ -283,7 +283,7 @@ func (r NeInfo) Update(neInfo model.NeInfo) int64 {
|
|||||||
uuid := generate.Code(4)
|
uuid := generate.Code(4)
|
||||||
for _, host := range neInfo.Hosts {
|
for _, host := range neInfo.Hosts {
|
||||||
if host.ID != 0 {
|
if host.ID != 0 {
|
||||||
host.Title = fmt.Sprintf("%s_%d_%s", neInfo.NeName, neInfo.Port, uuid)
|
host.Title = fmt.Sprintf("%s_%d_%s", neInfo.NeName, host.Port, uuid)
|
||||||
host.GroupID = "1"
|
host.GroupID = "1"
|
||||||
host.UpdateBy = neInfo.UpdateBy
|
host.UpdateBy = neInfo.UpdateBy
|
||||||
r.neHostService.Update(host)
|
r.neHostService.Update(host)
|
||||||
|
|||||||
Reference in New Issue
Block a user