You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "chickenlj (via GitHub)" <gi...@apache.org> on 2023/08/10 06:47:40 UTC

[GitHub] [dubbo-js] chickenlj opened a new issue, #345: 支持脱离 IDL 的开发模式

chickenlj opened a new issue, #345:
URL: https://github.com/apache/dubbo-js/issues/345

   ![image](https://github.com/apache/dubbo-js/assets/18097545/2069333c-d24e-4cb3-8405-b8b2d3b4180c)
   
   除了以上api之外,我们可以考虑引入新的api,让用户把service、method、arguments(json)直接输入进来,发起调用,比如,举个例子:
   
   对于IDL生成的ExampleService
   
   ```typescript
   export const ExampleService = {
     typeName: "apache.dubbo.demo.example.v1.ExampleService",
     methods: {
       /**
        * @generated from rpc apache.dubbo.demo.example.v1.ExampleService.Say
        */
       say: {
         name: "Say",
         I: SayRequest,
         O: SayResponse,
         kind: MethodKind.Unary,
       },
     }
   } as const;
   ```
   
   我们可以引入 API 
   const client = createGenericPromiseClient(transport);
   client.call("apache.dubbo.demo.example.v1.ExampleService", "say", {sentence:hello})
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org