package service

import (
	"dubbo.apache.org/dubbo-go/v3/common/constant"
	"dubbo.apache.org/dubbo-go/v3/config"
	_ "dubbo.apache.org/dubbo-go/v3/imports"
	"fmt"
	"fonchain-fiee/api/account"
	"fonchain-fiee/api/bundle"
	"fonchain-fiee/api/order"
	pkConfig "fonchain-fiee/pkg/config"
	"os"
)

var AccountProvider = new(account.AccountClientImpl)

var BundleProvider = new(bundle.BundleClientImpl)
var OrderProvider = new(order.OrderClientImpl)

func init() {
	config.SetConsumerService(BundleProvider)
	config.SetConsumerService(OrderProvider)
	config.SetConsumerService(AccountProvider)

	if err := config.Load(); err != nil {
		panic(err)
	}
	pkConfig.GetOptions()
	fmt.Println(os.Getenv(constant.ConfigFileEnvKey))

	if err := config.Load(); err != nil {
		panic(err)
	}
}
