Renaming suppliers methods from console

This commit is contained in:
TeoV
2018-02-26 04:20:17 -05:00
committed by Dan Christian Bogos
parent 72a46581aa
commit 3b41a175ff
4 changed files with 38 additions and 39 deletions

View File

@@ -24,43 +24,42 @@ import (
)
func init() {
c := &CmdSuppliersSort{
name: "suppliers_get",
rpcMethod: "SupplierSv1.GetSuppliers",
rpcParams: new(utils.CGREvent),
c := &CmdGetSupplier{
name: "supplier_get",
rpcMethod: "ApierV1.GetSupplierProfile",
rpcParams: &utils.TenantID{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
}
type CmdSuppliersSort struct {
name string
rpcMethod string
rpcParams *utils.CGREvent
clientArgs []string
type CmdGetSupplier struct {
name string
rpcMethod string
rpcParams *utils.TenantID
*CommandExecuter
}
func (self *CmdSuppliersSort) Name() string {
func (self *CmdGetSupplier) Name() string {
return self.name
}
func (self *CmdSuppliersSort) RpcMethod() string {
func (self *CmdGetSupplier) RpcMethod() string {
return self.rpcMethod
}
func (self *CmdSuppliersSort) RpcParams(reset bool) interface{} {
func (self *CmdGetSupplier) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = new(utils.CGREvent)
self.rpcParams = &utils.TenantID{}
}
return self.rpcParams
}
func (self *CmdSuppliersSort) PostprocessRpcParams() error {
func (self *CmdGetSupplier) PostprocessRpcParams() error {
return nil
}
func (self *CmdSuppliersSort) RpcResult() interface{} {
func (self *CmdGetSupplier) RpcResult() interface{} {
atr := engine.SupplierProfile{}
return &atr
}

View File

@@ -21,8 +21,8 @@ package console
import "github.com/cgrates/cgrates/utils"
func init() {
c := &CmdRemoveSuppliers{
name: "suppliers_remove",
c := &CmdRemoveSupplier{
name: "supplier_remove",
rpcMethod: "ApierV1.RemSupplierProfile",
rpcParams: &utils.TenantID{},
}
@@ -30,33 +30,33 @@ func init() {
c.CommandExecuter = &CommandExecuter{c}
}
type CmdRemoveSuppliers struct {
type CmdRemoveSupplier struct {
name string
rpcMethod string
rpcParams *utils.TenantID
*CommandExecuter
}
func (self *CmdRemoveSuppliers) Name() string {
func (self *CmdRemoveSupplier) Name() string {
return self.name
}
func (self *CmdRemoveSuppliers) RpcMethod() string {
func (self *CmdRemoveSupplier) RpcMethod() string {
return self.rpcMethod
}
func (self *CmdRemoveSuppliers) RpcParams(reset bool) interface{} {
func (self *CmdRemoveSupplier) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantID{}
}
return self.rpcParams
}
func (self *CmdRemoveSuppliers) PostprocessRpcParams() error {
func (self *CmdRemoveSupplier) PostprocessRpcParams() error {
return nil
}
func (self *CmdRemoveSuppliers) RpcResult() interface{} {
func (self *CmdRemoveSupplier) RpcResult() interface{} {
var s string
return &s
}

View File

@@ -22,7 +22,7 @@ import "github.com/cgrates/cgrates/engine"
func init() {
c := &CmdSetSuppliers{
name: "suppliers_set",
name: "supplier_set",
rpcMethod: "ApierV1.SetSupplierProfile",
rpcParams: &engine.SupplierProfile{},
}

View File

@@ -20,46 +20,46 @@ package console
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
func init() {
c := &CmdGetSuppliers{
c := &CmdSuppliersSort{
name: "suppliers",
rpcMethod: "ApierV1.GetSupplierProfile",
rpcParams: &utils.TenantID{},
rpcMethod: "SupplierSv1.GetSuppliers",
rpcParams: &engine.ArgsGetSuppliers{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
}
type CmdGetSuppliers struct {
name string
rpcMethod string
rpcParams *utils.TenantID
type CmdSuppliersSort struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetSuppliers
clientArgs []string
*CommandExecuter
}
func (self *CmdGetSuppliers) Name() string {
func (self *CmdSuppliersSort) Name() string {
return self.name
}
func (self *CmdGetSuppliers) RpcMethod() string {
func (self *CmdSuppliersSort) RpcMethod() string {
return self.rpcMethod
}
func (self *CmdGetSuppliers) RpcParams(reset bool) interface{} {
func (self *CmdSuppliersSort) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantID{}
self.rpcParams = &engine.ArgsGetSuppliers{}
}
return self.rpcParams
}
func (self *CmdGetSuppliers) PostprocessRpcParams() error {
func (self *CmdSuppliersSort) PostprocessRpcParams() error {
return nil
}
func (self *CmdGetSuppliers) RpcResult() interface{} {
atr := engine.SupplierProfile{}
func (self *CmdSuppliersSort) RpcResult() interface{} {
var atr *engine.SortedSuppliers
return &atr
}