mirror of
https://gitee.com/unitedrhino/things.git
synced 2025-12-06 14:59:15 +08:00
upper: 完善协议插件
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"gitee.com/unitedrhino/share/eventBus"
|
||||
"gitee.com/unitedrhino/share/events/topics"
|
||||
"gitee.com/unitedrhino/share/interceptors"
|
||||
"gitee.com/unitedrhino/share/services"
|
||||
"gitee.com/unitedrhino/share/utils"
|
||||
"gitee.com/unitedrhino/things/service/dmsvr/client/deviceinteract"
|
||||
"gitee.com/unitedrhino/things/service/dmsvr/client/devicemanage"
|
||||
@@ -141,7 +142,7 @@ func (p *CoreProtocol) Start() error {
|
||||
}
|
||||
if len(p.rpcRegisters) != 0 {
|
||||
utils.Go(context.Background(), func() {
|
||||
s := zrpc.MustNewServer(p.rpcConf, func(grpcServer *grpc.Server) {
|
||||
s := services.MustNewServer(p.rpcConf, func(grpcServer *grpc.Server) {
|
||||
for _, f := range p.rpcRegisters {
|
||||
f(grpcServer)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"gitee.com/unitedrhino/share/interceptors"
|
||||
"gitee.com/unitedrhino/share/services"
|
||||
|
||||
"gitee.com/unitedrhino/things/share/rpcs/protocolSync/internal/config"
|
||||
protocolsyncServer "gitee.com/unitedrhino/things/share/rpcs/protocolSync/internal/server/protocolsync"
|
||||
@@ -13,7 +14,6 @@ import (
|
||||
|
||||
"gitee.com/unitedrhino/share/utils"
|
||||
"github.com/zeromicro/go-zero/core/service"
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/reflection"
|
||||
)
|
||||
@@ -24,7 +24,7 @@ func main() {
|
||||
utils.ConfMustLoad("etc/protocolSync.yaml", &c)
|
||||
svcCtx := svc.NewServiceContext(c)
|
||||
startup.Init(svcCtx)
|
||||
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
||||
s := services.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
||||
protocolSync.RegisterProtocolSyncServer(grpcServer, protocolsyncServer.NewProtocolSyncServer(svcCtx))
|
||||
|
||||
if c.Mode == service.DevMode || c.Mode == service.TestMode {
|
||||
|
||||
Reference in New Issue
Block a user