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

package svc

import (
	"juwan-backend/app/user_verifications/rpc/userverifications"
	"juwan-backend/app/users/api/internal/config"
	"juwan-backend/app/users/api/internal/middleware"
	"juwan-backend/app/users/rpc/usercenter"

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

type ServiceContext struct {
	Config               config.Config
	Logger               rest.Middleware
	UserRpc              usercenter.Usercenter
	UserVerificationsRpc userverifications.UserVerificationsZrpcClient
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:               c,
		Logger:               middleware.NewLoggerMiddleware().Handle,
		UserRpc:              usercenter.NewUsercenter(zrpc.MustNewClient(c.UsercenterRpcConf)),
		UserVerificationsRpc: userverifications.NewUserVerificationsZrpcClient(zrpc.MustNewClient(c.UserVerificationRpc)),
	}
}
