|
|
@@ -16,11 +16,8 @@ import (
|
|
|
"google.golang.org/protobuf/proto"
|
|
|
)
|
|
|
|
|
|
-func RegisterRoute(s *http.Server, srv any, svcDesc grpc.ServiceDesc, baseUrl string) {
|
|
|
- r := s.Route("/api/")
|
|
|
- if baseUrl != "" {
|
|
|
- r = s.Route(baseUrl)
|
|
|
- }
|
|
|
+func RegisterRoute(s *http.Server, srv any, svcDesc grpc.ServiceDesc) {
|
|
|
+ r := s.Route("/")
|
|
|
|
|
|
// 加载完整的服务描述符
|
|
|
fullSvcDesc, err := grpcreflect.LoadServiceDescriptor(&svcDesc)
|
|
|
@@ -117,7 +114,7 @@ func GetOptionByServiceDescriptor(sd *desc.ServiceDescriptor, serviceName, metho
|
|
|
}
|
|
|
}
|
|
|
if option.Path == "" {
|
|
|
- option.Path = fmt.Sprintf("/%s/%s", serviceName, methodName)
|
|
|
+ option.Path = pathGenerator(serviceName, methodName)
|
|
|
}
|
|
|
if option.Method == "" {
|
|
|
option.Method = http2.MethodPost
|