test-errcode
wangchuxiao 2 years ago
parent c0afe5d24a
commit 4f0813889c

@ -7,6 +7,8 @@ import (
"OpenIM/pkg/common/prome" "OpenIM/pkg/common/prome"
"OpenIM/pkg/discoveryregistry" "OpenIM/pkg/discoveryregistry"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"io" "io"
"os" "os"
) )
@ -26,7 +28,7 @@ func NewGinRouter(zk discoveryregistry.SvcDiscoveryRegistry) *gin.Engine {
r.Use(prome.PrometheusMiddleware) r.Use(prome.PrometheusMiddleware)
r.GET("/metrics", prome.PrometheusHandler()) r.GET("/metrics", prome.PrometheusHandler())
} }
zk.AddOption(mw.GrpcClient()) // 默认RPC中间件 zk.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials())) // 默认RPC中间件
userRouterGroup := r.Group("/user") userRouterGroup := r.Group("/user")
{ {
u := NewUser(zk) u := NewUser(zk)

Loading…
Cancel
Save