package svc

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

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

type ServiceContext struct {
	Config    config.Config
	ReviewRpc reviewservice.ReviewService
	OrderRpc  orderservice.OrderService
	PlayerRpc playerservice.PlayerService
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:    c,
		ReviewRpc: reviewservice.NewReviewService(zrpc.MustNewClient(c.ReviewRpcConf)),
		OrderRpc:  orderservice.NewOrderService(zrpc.MustNewClient(c.OrderRpcConf)),
		PlayerRpc: playerservice.NewPlayerService(zrpc.MustNewClient(c.PlayerRpcConf)),
	}
}
