feat kafka 改版 2
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user