Fixed conflicts

This commit is contained in:
porosnicuadrian
2021-03-18 18:33:50 +02:00
committed by Dan Christian Bogos
parent 93df974ba7
commit d4d602001c
6 changed files with 12 additions and 15 deletions

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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...)
}

View File

@@ -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 {

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
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

View File

@@ -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