mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Update toExportMap to initialize the slices with make()
This commit is contained in:
committed by
Dan Christian Bogos
parent
d2fabb428c
commit
ecc452703a
@@ -92,8 +92,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
|
||||
}
|
||||
storDataModelTimings := APItoModelTimings(storDataTimings)
|
||||
for _, sd := range storDataModelTimings {
|
||||
toExportMap[utils.TimingsCsv] = append(toExportMap[utils.TimingsCsv], sd)
|
||||
toExportMap[utils.TimingsCsv] = make([]interface{}, len(storDataModelTimings))
|
||||
for i, sd := range storDataModelTimings {
|
||||
toExportMap[utils.TimingsCsv][i] = sd
|
||||
}
|
||||
|
||||
storDataDestinations, err := tpExp.storDb.GetTPDestinations(tpExp.tpID, "")
|
||||
@@ -103,8 +104,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataDestinations {
|
||||
sdModels := APItoModelDestination(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.DestinationsCsv] = append(toExportMap[utils.DestinationsCsv], sdModel)
|
||||
toExportMap[utils.DestinationsCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.DestinationsCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,8 +117,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataRates {
|
||||
sdModels := APItoModelRate(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.RatesCsv] = append(toExportMap[utils.RatesCsv], sdModel)
|
||||
toExportMap[utils.RatesCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.RatesCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,8 +130,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataDestinationRates {
|
||||
sdModels := APItoModelDestinationRate(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.DestinationRatesCsv] = append(toExportMap[utils.DestinationRatesCsv], sdModel)
|
||||
toExportMap[utils.DestinationRatesCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.DestinationRatesCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,8 +143,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataRatingPlans {
|
||||
sdModels := APItoModelRatingPlan(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.RatingPlansCsv] = append(toExportMap[utils.RatingPlansCsv], sdModel)
|
||||
toExportMap[utils.RatingPlansCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.RatingPlansCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,8 +156,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataRatingProfiles {
|
||||
sdModels := APItoModelRatingProfile(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.RatingProfilesCsv] = append(toExportMap[utils.RatingProfilesCsv], sdModel)
|
||||
toExportMap[utils.RatingProfilesCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.RatingProfilesCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,8 +170,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
|
||||
for _, sd := range storDataSharedGroups {
|
||||
sdModels := APItoModelSharedGroup(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.SharedGroupsCsv] = append(toExportMap[utils.SharedGroupsCsv], sdModel)
|
||||
toExportMap[utils.SharedGroupsCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.SharedGroupsCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,8 +183,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataActions {
|
||||
sdModels := APItoModelAction(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.ActionsCsv] = append(toExportMap[utils.ActionsCsv], sdModel)
|
||||
toExportMap[utils.ActionsCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.ActionsCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,8 +196,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataActionPlans {
|
||||
sdModels := APItoModelActionPlan(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.ActionPlansCsv] = append(toExportMap[utils.ActionPlansCsv], sdModel)
|
||||
toExportMap[utils.ActionPlansCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.ActionPlansCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,8 +209,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataActionTriggers {
|
||||
sdModels := APItoModelActionTrigger(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.ActionTriggersCsv] = append(toExportMap[utils.ActionTriggersCsv], sdModel)
|
||||
toExportMap[utils.ActionTriggersCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.ActionTriggersCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,8 +232,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataResources {
|
||||
sdModels := APItoModelResource(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.ResourcesCsv] = append(toExportMap[utils.ResourcesCsv], sdModel)
|
||||
toExportMap[utils.ResourcesCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.ResourcesCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,8 +245,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataStats {
|
||||
sdModels := APItoModelStats(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.StatsCsv] = append(toExportMap[utils.StatsCsv], sdModel)
|
||||
toExportMap[utils.StatsCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.StatsCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,8 +258,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataThresholds {
|
||||
sdModels := APItoModelTPThreshold(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.ThresholdsCsv] = append(toExportMap[utils.ThresholdsCsv], sdModel)
|
||||
toExportMap[utils.ThresholdsCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.ThresholdsCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,8 +271,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataFilters {
|
||||
sdModels := APItoModelTPFilter(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.FiltersCsv] = append(toExportMap[utils.FiltersCsv], sdModel)
|
||||
toExportMap[utils.FiltersCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.FiltersCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,8 +284,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataRoutes {
|
||||
sdModels := APItoModelTPRoutes(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.RoutesCsv] = append(toExportMap[utils.RoutesCsv], sdModel)
|
||||
toExportMap[utils.RoutesCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.RoutesCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,8 +297,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storeDataAttributes {
|
||||
sdModels := APItoModelTPAttribute(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.AttributesCsv] = append(toExportMap[utils.AttributesCsv], sdModel)
|
||||
toExportMap[utils.AttributesCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.AttributesCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,8 +310,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataChargers {
|
||||
sdModels := APItoModelTPCharger(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.ChargersCsv] = append(toExportMap[utils.ChargersCsv], sdModel)
|
||||
toExportMap[utils.ChargersCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.ChargersCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,8 +323,9 @@ func (tpExp *TPExporter) Run() error {
|
||||
}
|
||||
for _, sd := range storDataDispatcherProfiles {
|
||||
sdModels := APItoModelTPDispatcherProfile(sd)
|
||||
for _, sdModel := range sdModels {
|
||||
toExportMap[utils.DispatcherProfilesCsv] = append(toExportMap[utils.DispatcherProfilesCsv], sdModel)
|
||||
toExportMap[utils.DispatcherProfilesCsv] = make([]interface{}, len(sdModels))
|
||||
for i, sdModel := range sdModels {
|
||||
toExportMap[utils.DispatcherProfilesCsv][i] = sdModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user