package svc

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

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

type ServiceContext struct {
	Config     config.Config
	DisputeRpc disputeservice.DisputeService
	OrderRpc   orderservice.OrderService
	PlayerRpc  playerservice.PlayerService
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:     c,
		DisputeRpc: disputeservice.NewDisputeService(zrpc.MustNewClient(c.DisputeRpcConf)),
		OrderRpc:   orderservice.NewOrderService(zrpc.MustNewClient(c.OrderRpcConf)),
		PlayerRpc:  playerservice.NewPlayerService(zrpc.MustNewClient(c.PlayerRpcConf)),
	}
}
