// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2

package svc

import (
	"juwan-backend/app/order/api/internal/config"
	"juwan-backend/app/order/rpc/orderservice"
	"juwan-backend/app/player/rpc/playerservice"
	"juwan-backend/app/shop/rpc/shopservice"

	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config    config.Config
	OrderRpc  orderservice.OrderService
	PlayerRpc playerservice.PlayerService
	ShopRpc   shopservice.ShopService
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:    c,
		OrderRpc:  orderservice.NewOrderService(zrpc.MustNewClient(c.OrderRpcConf)),
		PlayerRpc: playerservice.NewPlayerService(zrpc.MustNewClient(c.PlayerRpcConf)),
		ShopRpc:   shopservice.NewShopService(zrpc.MustNewClient(c.ShopRpcConf)),
	}
}
