//go:build !ignore_autogenerated
// +build !ignore_autogenerated

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

package service

import (
	autowire "github.com/alibaba/ioc-golang/autowire"
	normal "github.com/alibaba/ioc-golang/autowire/normal"
	util "github.com/alibaba/ioc-golang/autowire/util"
	"github.com/alibaba/ioc-golang/example/autowire/autowire_rpc/client/test/dto"
	rpc_service "github.com/alibaba/ioc-golang/extension/autowire/rpc/rpc_service"
)

func init() {
	normal.RegisterStructDescriptor(&autowire.StructDescriptor{
		Factory: func() interface{} {
			return &complexService_{}
		},
	})
	complexServiceStructDescriptor := &autowire.StructDescriptor{
		Alias: "github.com/alibaba/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.ComplexServiceIOCRPCClient",
		Factory: func() interface{} {
			return &ComplexService{}
		},
		Metadata: map[string]interface{}{
			"aop":      map[string]interface{}{},
			"autowire": map[string]interface{}{},
		},
	}
	rpc_service.RegisterStructDescriptor(complexServiceStructDescriptor)
	normal.RegisterStructDescriptor(&autowire.StructDescriptor{
		Factory: func() interface{} {
			return &simpleService_{}
		},
	})
	simpleServiceStructDescriptor := &autowire.StructDescriptor{
		Alias: "github.com/alibaba/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.SimpleServiceIOCRPCClient",
		Factory: func() interface{} {
			return &SimpleService{}
		},
		Metadata: map[string]interface{}{
			"aop":      map[string]interface{}{},
			"autowire": map[string]interface{}{},
		},
	}
	rpc_service.RegisterStructDescriptor(simpleServiceStructDescriptor)
}

type complexService_ struct {
	RPCBasicType_                  func(name string, age int, age32 int32, age64 int64, ageF32 float32, ageF64 float64, namePtr *string, agePtr *int, age32Ptr *int32, age64Ptr *int64, ageF32Ptr *float32, ageF64Ptr *float64) (string, int, int32, int64, float32, float64, *string, *int, *int32, *int64, *float32, *float64)
	RPCWithoutParamAndReturnValue_ func()
	RPCWithoutParam_               func() (*dto.User, error)
	RPCWithoutReturnValue_         func(user *dto.User)
	RPCWithCustomValue_            func(customStruct dto.CustomStruct, customStruct2 *dto.CustomStruct) (dto.CustomStruct, *dto.CustomStruct)
	RPCWithError_                  func() (*dto.User, error)
	RPCWithParamCustomMethod_      func(customStruct dto.CustomStruct) dto.User
}

func (c *complexService_) RPCBasicType(name string, age int, age32 int32, age64 int64, ageF32 float32, ageF64 float64, namePtr *string, agePtr *int, age32Ptr *int32, age64Ptr *int64, ageF32Ptr *float32, ageF64Ptr *float64) (string, int, int32, int64, float32, float64, *string, *int, *int32, *int64, *float32, *float64) {
	return c.RPCBasicType_(name, age, age32, age64, ageF32, ageF64, namePtr, agePtr, age32Ptr, age64Ptr, ageF32Ptr, ageF64Ptr)
}

func (c *complexService_) RPCWithoutParamAndReturnValue() {
	c.RPCWithoutParamAndReturnValue_()
}

func (c *complexService_) RPCWithoutParam() (*dto.User, error) {
	return c.RPCWithoutParam_()
}

func (c *complexService_) RPCWithoutReturnValue(user *dto.User) {
	c.RPCWithoutReturnValue_(user)
}

func (c *complexService_) RPCWithCustomValue(customStruct dto.CustomStruct, customStruct2 *dto.CustomStruct) (dto.CustomStruct, *dto.CustomStruct) {
	return c.RPCWithCustomValue_(customStruct, customStruct2)
}

func (c *complexService_) RPCWithError() (*dto.User, error) {
	return c.RPCWithError_()
}

func (c *complexService_) RPCWithParamCustomMethod(customStruct dto.CustomStruct) dto.User {
	return c.RPCWithParamCustomMethod_(customStruct)
}

type simpleService_ struct {
	GetUser_ func(name string, age int) (*dto.User, error)
}

func (s *simpleService_) GetUser(name string, age int) (*dto.User, error) {
	return s.GetUser_(name, age)
}

type ComplexServiceIOCInterface interface {
	RPCBasicType(name string, age int, age32 int32, age64 int64, ageF32 float32, ageF64 float64, namePtr *string, agePtr *int, age32Ptr *int32, age64Ptr *int64, ageF32Ptr *float32, ageF64Ptr *float64) (string, int, int32, int64, float32, float64, *string, *int, *int32, *int64, *float32, *float64)
	RPCWithoutParamAndReturnValue()
	RPCWithoutParam() (*dto.User, error)
	RPCWithoutReturnValue(user *dto.User)
	RPCWithCustomValue(customStruct dto.CustomStruct, customStruct2 *dto.CustomStruct) (dto.CustomStruct, *dto.CustomStruct)
	RPCWithError() (*dto.User, error)
	RPCWithParamCustomMethod(customStruct dto.CustomStruct) dto.User
}

type SimpleServiceIOCInterface interface {
	GetUser(name string, age int) (*dto.User, error)
}

var _complexServiceSDID string

func GetComplexServiceRpc() (*ComplexService, error) {
	if _complexServiceSDID == "" {
		_complexServiceSDID = util.GetSDIDByStructPtr(new(ComplexService))
	}
	i, err := rpc_service.GetImpl(_complexServiceSDID)
	if err != nil {
		return nil, err
	}
	impl := i.(*ComplexService)
	return impl, nil
}

func GetComplexServiceIOCInterfaceRpc() (ComplexServiceIOCInterface, error) {
	if _complexServiceSDID == "" {
		_complexServiceSDID = util.GetSDIDByStructPtr(new(ComplexService))
	}
	i, err := rpc_service.GetImplWithProxy(_complexServiceSDID)
	if err != nil {
		return nil, err
	}
	impl := i.(ComplexServiceIOCInterface)
	return impl, nil
}

var _simpleServiceSDID string

func GetSimpleServiceRpc() (*SimpleService, error) {
	if _simpleServiceSDID == "" {
		_simpleServiceSDID = util.GetSDIDByStructPtr(new(SimpleService))
	}
	i, err := rpc_service.GetImpl(_simpleServiceSDID)
	if err != nil {
		return nil, err
	}
	impl := i.(*SimpleService)
	return impl, nil
}

func GetSimpleServiceIOCInterfaceRpc() (SimpleServiceIOCInterface, error) {
	if _simpleServiceSDID == "" {
		_simpleServiceSDID = util.GetSDIDByStructPtr(new(SimpleService))
	}
	i, err := rpc_service.GetImplWithProxy(_simpleServiceSDID)
	if err != nil {
		return nil, err
	}
	impl := i.(SimpleServiceIOCInterface)
	return impl, nil
}
