feat kafka 改版 2

This commit is contained in:
2026-01-30 11:02:55 +08:00
parent 3b14697a45
commit 9781cd126f
7 changed files with 18 additions and 10 deletions

View File

@@ -5,12 +5,15 @@ import (
"git.hlsq.asia/mmorpg/service-common/discover/common"
"git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb"
"git.hlsq.asia/mmorpg/service-user/internal/dao/query"
"git.hlsq.asia/mmorpg/service-user/internal/dao/repository"
"google.golang.org/grpc"
)
type Server struct {
grpc_pb.UnimplementedUserServer
service.Base
query *query.Query
}
func NewServer(cfg *config.GrpcConfig) *Server {
@@ -33,6 +36,7 @@ func (s *Server) OnCustomGrpcServerOption() []grpc.ServerOption {
func (s *Server) OnInit(serve *grpc.Server) {
grpc_pb.RegisterUserServer(serve, s)
s.query = repository.Query()
}
func (s *Server) OnClose() {