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
|
* @Date: 2021-06-17 00:19:32
|
||||||
* @LastEditors: viletyy
|
* @LastEditors: viletyy
|
||||||
* @LastEditTime: 2021-07-09 14:24:14
|
* @LastEditTime: 2021-07-09 14:52:03
|
||||||
* @FilePath: /potato/initialize/grpc_server.go
|
* @FilePath: /potato/initialize/grpc_server.go
|
||||||
*/
|
*/
|
||||||
package initialize
|
package initialize
|
||||||
|
@ -9,7 +9,9 @@ package initialize
|
||||||
import (
|
import (
|
||||||
"net"
|
"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"
|
"github.com/viletyy/potato/server/basic"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/reflection"
|
"google.golang.org/grpc/reflection"
|
||||||
|
@ -17,7 +19,9 @@ import (
|
||||||
|
|
||||||
func RunGrpcServer(port string) error {
|
func RunGrpcServer(port string) error {
|
||||||
server := grpc.NewServer()
|
server := grpc.NewServer()
|
||||||
pb.RegisterVendorServiceServer(server, basic.NewVendorServer())
|
basic_pb.RegisterVendorServiceServer(server, basic.NewVendorServer())
|
||||||
|
pb.RegisterUserServiceServer(server, grpc_server.NewUserServer())
|
||||||
|
|
||||||
reflection.Register(server)
|
reflection.Register(server)
|
||||||
|
|
||||||
lis, err := net.Listen("tcp", ":"+port)
|
lis, err := net.Listen("tcp", ":"+port)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* @Date: 2021-07-09 14:33:26
|
* @Date: 2021-07-09 14:33:26
|
||||||
* @LastEditors: viletyy
|
* @LastEditors: viletyy
|
||||||
* @LastEditTime: 2021-07-09 14:34:16
|
* @LastEditTime: 2021-07-09 14:52:23
|
||||||
* @FilePath: /potato/server/user.go
|
* @FilePath: /potato/server/user.go
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ type UserServer struct {
|
||||||
pb.UnimplementedUserServiceServer
|
pb.UnimplementedUserServiceServer
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewVendorServer() *UserServer {
|
func NewUserServer() *UserServer {
|
||||||
return &UserServer{}
|
return &UserServer{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue