From d4d602001c67dd301ff0f2e8858d71ad77d7ecb6 Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Thu, 18 Mar 2021 18:33:50 +0200 Subject: [PATCH] Fixed conflicts --- apier/v1/api_interfaces.go | 2 +- apier/v1/dispatcher.go | 2 +- apier/v1/rateprofiles.go | 6 +++--- apier/v1/replicator.go | 2 +- console/rates_profile_set.go | 13 +++++-------- dispatchers/replicator.go | 2 +- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/apier/v1/api_interfaces.go b/apier/v1/api_interfaces.go index 8ff5cffe3..fa28f5974 100644 --- a/apier/v1/api_interfaces.go +++ b/apier/v1/api_interfaces.go @@ -216,7 +216,7 @@ type ReplicatorSv1Interface interface { GetAttributeProfile(tntID *utils.TenantIDWithAPIOpts, reply *engine.AttributeProfile) error GetChargerProfile(tntID *utils.TenantIDWithAPIOpts, reply *engine.ChargerProfile) error GetDispatcherProfile(tntID *utils.TenantIDWithAPIOpts, reply *engine.DispatcherProfile) error - GetRateProfile(tntID *utils.TenantIDWithAPIOpts, reply *engine.RateProfile) error + GetRateProfile(tntID *utils.TenantIDWithAPIOpts, reply *utils.RateProfile) error GetDispatcherHost(tntID *utils.TenantIDWithAPIOpts, reply *engine.DispatcherHost) error GetItemLoadIDs(itemID *utils.StringWithAPIOpts, reply *map[string]int64) error SetThresholdProfile(th *engine.ThresholdProfileWithAPIOpts, reply *string) error diff --git a/apier/v1/dispatcher.go b/apier/v1/dispatcher.go index 5c0bfbb26..78bd953c3 100755 --- a/apier/v1/dispatcher.go +++ b/apier/v1/dispatcher.go @@ -1020,7 +1020,7 @@ func (dS *DispatcherReplicatorSv1) GetDispatcherProfile(tntID *utils.TenantIDWit } // GetRateProfile -func (dS *DispatcherReplicatorSv1) GetRateProfile(tntID *utils.TenantIDWithAPIOpts, reply *engine.RateProfile) error { +func (dS *DispatcherReplicatorSv1) GetRateProfile(tntID *utils.TenantIDWithAPIOpts, reply *utils.RateProfile) error { return dS.dS.ReplicatorSv1GetRateProfile(tntID, reply) } diff --git a/apier/v1/rateprofiles.go b/apier/v1/rateprofiles.go index dd6184f9c..8269040c1 100644 --- a/apier/v1/rateprofiles.go +++ b/apier/v1/rateprofiles.go @@ -27,7 +27,7 @@ import ( ) // GetRateProfile returns an Rate Profile -func (apierSv1 *APIerSv1) GetRateProfile(arg *utils.TenantIDWithAPIOpts, reply *engine.RateProfile) error { +func (apierSv1 *APIerSv1) GetRateProfile(arg *utils.TenantIDWithAPIOpts, reply *utils.RateProfile) error { if missing := utils.MissingStructFields(arg, []string{utils.ID}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } @@ -88,7 +88,7 @@ func (apierSv1 *APIerSv1) GetRateProfileIDsCount(args *utils.TenantWithAPIOpts, } //SetRateProfile add/update a new Rate Profile -func (apierSv1 *APIerSv1) SetRateProfile(ext *engine.APIRateProfileWithOpts, reply *string) error { +func (apierSv1 *APIerSv1) SetRateProfile(ext *utils.APIRateProfileWithOpts, reply *string) error { if missing := utils.MissingStructFields(ext.APIRateProfile, []string{utils.ID, utils.Rates}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) } @@ -115,7 +115,7 @@ func (apierSv1 *APIerSv1) SetRateProfile(ext *engine.APIRateProfileWithOpts, rep } //SetRateProfileRates add/update Rates from existing RateProfiles -func (apierSv1 *APIerSv1) SetRateProfileRates(ext *engine.APIRateProfileWithOpts, reply *string) (err error) { +func (apierSv1 *APIerSv1) SetRateProfileRates(ext *utils.APIRateProfileWithOpts, reply *string) (err error) { if missing := utils.MissingStructFields(ext.APIRateProfile, []string{utils.ID, utils.Rates}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/replicator.go b/apier/v1/replicator.go index 6182a2679..1c6ad7764 100644 --- a/apier/v1/replicator.go +++ b/apier/v1/replicator.go @@ -311,7 +311,7 @@ func (rplSv1 *ReplicatorSv1) GetDispatcherHost(tntID *utils.TenantIDWithAPIOpts, } // GetRateProfile is the remote method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) GetRateProfile(tntID *utils.TenantIDWithAPIOpts, reply *engine.RateProfile) error { +func (rplSv1 *ReplicatorSv1) GetRateProfile(tntID *utils.TenantIDWithAPIOpts, reply *utils.RateProfile) error { engine.UpdateReplicationFilters(utils.RateProfilePrefix, tntID.TenantID.TenantID(), utils.IfaceAsString(tntID.APIOpts[utils.RemoteHostOpt])) rcv, err := rplSv1.dm.DataDB().GetRateProfileDrv(tntID.Tenant, tntID.ID) if err != nil { diff --git a/console/rates_profile_set.go b/console/rates_profile_set.go index 826c9d790..b566ba37f 100644 --- a/console/rates_profile_set.go +++ b/console/rates_profile_set.go @@ -19,7 +19,6 @@ along with this program. If not, see package console import ( - "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" ) @@ -27,7 +26,7 @@ func init() { c := &CmdSetRateProfile{ name: "rates_profile_set", rpcMethod: utils.APIerSv1SetRateProfile, - rpcParams: &engine.APIRateProfileWithOpts{}, + rpcParams: &utils.APIRateProfileWithOpts{}, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} @@ -36,7 +35,7 @@ func init() { type CmdSetRateProfile struct { name string rpcMethod string - rpcParams *engine.APIRateProfileWithOpts + rpcParams *utils.APIRateProfileWithOpts *CommandExecuter } @@ -50,11 +49,9 @@ func (self *CmdSetRateProfile) RpcMethod() string { func (self *CmdSetRateProfile) RpcParams(reset bool) interface{} { if reset || self.rpcParams == nil { - self.rpcParams = &v1.APIRateProfileWithCache{ - APIRateProfileWithOpts: &utils.APIRateProfileWithOpts{ - APIRateProfile: new(utils.APIRateProfile), - Opts: make(map[string]interface{}), - }, + self.rpcParams = &utils.APIRateProfileWithOpts{ + APIRateProfile: new(utils.APIRateProfile), + Opts: make(map[string]interface{}), } } return self.rpcParams diff --git a/dispatchers/replicator.go b/dispatchers/replicator.go index a5ed36862..a5389d957 100644 --- a/dispatchers/replicator.go +++ b/dispatchers/replicator.go @@ -459,7 +459,7 @@ func (dS *DispatcherService) ReplicatorSv1GetDispatcherHost(args *utils.TenantID }, utils.MetaReplicator, utils.ReplicatorSv1GetDispatcherHost, args, reply) } -func (dS *DispatcherService) ReplicatorSv1GetRateProfile(args *utils.TenantIDWithAPIOpts, reply *engine.RateProfile) (err error) { +func (dS *DispatcherService) ReplicatorSv1GetRateProfile(args *utils.TenantIDWithAPIOpts, reply *utils.RateProfile) (err error) { tnt := dS.cfg.GeneralCfg().DefaultTenant if args.TenantID != nil && args.TenantID.Tenant != utils.EmptyString { tnt = args.TenantID.Tenant