upper: 完善协议插件

This commit is contained in:
godLei6
2025-03-25 10:23:12 +08:00
parent 4a9a77652e
commit fda2fcf452
2 changed files with 4 additions and 3 deletions

View File

@@ -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)
}

View File

@@ -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 {