From f37f26176b3aedfd788de94ea335ef44f2719027 Mon Sep 17 00:00:00 2001 From: viletyy Date: Fri, 9 Jul 2021 14:53:23 +0800 Subject: [PATCH] fix: user grpc server register --- initialize/grpc_server.go | 10 +++++++--- server/user.go | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/initialize/grpc_server.go b/initialize/grpc_server.go index 0d23739..8d305c7 100644 --- a/initialize/grpc_server.go +++ b/initialize/grpc_server.go @@ -1,7 +1,7 @@ /* * @Date: 2021-06-17 00:19:32 * @LastEditors: viletyy - * @LastEditTime: 2021-07-09 14:24:14 + * @LastEditTime: 2021-07-09 14:52:03 * @FilePath: /potato/initialize/grpc_server.go */ package initialize @@ -9,7 +9,9 @@ package initialize import ( "net" - pb "github.com/viletyy/potato/proto/basic" + pb "github.com/viletyy/potato/proto" + basic_pb "github.com/viletyy/potato/proto/basic" + grpc_server "github.com/viletyy/potato/server" "github.com/viletyy/potato/server/basic" "google.golang.org/grpc" "google.golang.org/grpc/reflection" @@ -17,7 +19,9 @@ import ( func RunGrpcServer(port string) error { server := grpc.NewServer() - pb.RegisterVendorServiceServer(server, basic.NewVendorServer()) + basic_pb.RegisterVendorServiceServer(server, basic.NewVendorServer()) + pb.RegisterUserServiceServer(server, grpc_server.NewUserServer()) + reflection.Register(server) lis, err := net.Listen("tcp", ":"+port) diff --git a/server/user.go b/server/user.go index b3f6f34..9250fc4 100644 --- a/server/user.go +++ b/server/user.go @@ -1,7 +1,7 @@ /* * @Date: 2021-07-09 14:33:26 * @LastEditors: viletyy - * @LastEditTime: 2021-07-09 14:34:16 + * @LastEditTime: 2021-07-09 14:52:23 * @FilePath: /potato/server/user.go */ @@ -21,7 +21,7 @@ type UserServer struct { pb.UnimplementedUserServiceServer } -func NewVendorServer() *UserServer { +func NewUserServer() *UserServer { return &UserServer{} }