mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-22 03:48:48 +00:00
refactor: Replace manual map copy with maps.Copy in carrier-connector message queue
- Add maps import to mq.go - Replace manual for loop copying payload map with maps.Copy in PublishProfileEvent - Simplify map merging logic while maintaining same functionality
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -125,9 +126,7 @@ func (mq *MessageQueue) PublishProfileEvent(eventType string, profileID string,
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range payload {
|
maps.Copy(msg.Payload, payload)
|
||||||
msg.Payload[k] = v
|
|
||||||
}
|
|
||||||
|
|
||||||
return mq.Publish("profile-events", msg)
|
return mq.Publish("profile-events", msg)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user