add: 打手初始化接口

This commit is contained in:
zetaloop
2026-04-04 03:35:36 +08:00
parent 85ce6a45c5
commit 32d58ef462
12 changed files with 224 additions and 21 deletions
@@ -6,6 +6,7 @@ package svc
import (
"juwan-backend/app/player/api/internal/config"
"juwan-backend/app/player/rpc/playerservice"
"juwan-backend/app/users/rpc/usercenter"
"github.com/zeromicro/go-zero/zrpc"
)
@@ -13,11 +14,13 @@ import (
type ServiceContext struct {
Config config.Config
PlayerRpc playerservice.PlayerService
UserRpc usercenter.Usercenter
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
PlayerRpc: playerservice.NewPlayerService(zrpc.MustNewClient(c.PlayerRpcConf)),
UserRpc: usercenter.NewUsercenter(zrpc.MustNewClient(c.UsercenterRpcConf)),
}
}