// Code generated by iocli, run 'iocli gen' to re-generate

package api

import (
	"github.com/alibaba/ioc-golang/autowire"
	"github.com/alibaba/ioc-golang/autowire/normal"
	"github.com/alibaba/ioc-golang/extension/autowire/rpc/rpc_client"
)

func init() {
	rpc_client.RegisterStructDescriptor(&autowire.StructDescriptor{
		Factory: func() interface{} {
			return &bankServiceIOCRPCClient{}
		},
		Metadata: map[string]interface{}{
			"aop": map[string]interface{}{
				"transaction": map[string]string{
					"AddMoney":    "AddMoneyRollback",
					"RemoveMoney": "RemoveMoneyRollback",
				},
			},
			"autowire": map[string]interface{}{},
		},
	})
	normal.RegisterStructDescriptor(&autowire.StructDescriptor{
		Factory: func() interface{} {
			return &bankServiceIOCRPCClient_{}
		},
	})
}

type bankServiceIOCRPCClient_ struct {
	GetMoney_            func(id int) int
	AddMoney_            func(id, num int) error
	AddMoneyRollback_    func(id, num int, errMsg string)
	RemoveMoney_         func(id, num int) error
	RemoveMoneyRollback_ func(id, num int, errMsg string)
}

func (b *bankServiceIOCRPCClient_) GetMoney(id int) int {
	return b.GetMoney_(id)
}

func (b *bankServiceIOCRPCClient_) AddMoney(id, num int) error {
	return b.AddMoney_(id, num)
}

func (b *bankServiceIOCRPCClient_) AddMoneyRollback(id, num int, errMsg string) {
	b.AddMoneyRollback_(id, num, errMsg)
}

func (b *bankServiceIOCRPCClient_) RemoveMoney(id, num int) error {
	return b.RemoveMoney_(id, num)
}

func (b *bankServiceIOCRPCClient_) RemoveMoneyRollback(id, num int, errMsg string) {
	b.RemoveMoneyRollback_(id, num, errMsg)
}

type BankServiceIOCRPCClient interface {
	GetMoney(id int) int
	AddMoney(id, num int) error
	AddMoneyRollback(id, num int, errMsg string)
	RemoveMoney(id, num int) error
	RemoveMoneyRollback(id, num int, errMsg string)
}

type bankServiceIOCRPCClient struct {
	GetMoney            func(id int) int
	AddMoney            func(id, num int) error
	AddMoneyRollback    func(id, num int, errMsg string)
	RemoveMoney         func(id, num int) error
	RemoveMoneyRollback func(id, num int, errMsg string)
}
