fix: user grpc server register
This commit is contained in:
parent
57f071922e
commit
f37f26176b
|
@ -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)
|
||||
|
|
|
@ -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{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue