zwZjut commented on pull request #8946:
URL: 
https://github.com/apache/dolphinscheduler/pull/8946#issuecomment-1070255141


   The PR logic of Java SDK:It is divided into three layers. 
   (1)encapsulate a client for okhttp; 
   (2)encapsulate the call parameters; 
   (3)encapsulate a dolphin client as dsclient, and each dolphin's OpenAPI 
corresponds to a request and response; 
   All newly added interfaces should be implemented in the way that they have 
been implemented, combined with the open API document of dolphin, and just 
follow the example. At present, more than 50 of the main interfaces we use have 
been implemented, and others can be added as needed. Use token  of dolphin to 
make HTTP call.
   
   use dsclient to create project example:
   
    DSClient dsClient = DSClientHelper.getClient("xxx","xxxx");
    CreateProjectRequest request = new CreateProjectRequest();
    request.body.projectName = "xxxx";
    request.body.description = "xxxx";
    CreateProjectResponse response = dsClient.createProject(request);
   
   add a http call example:
   (1)add XXXRequest.java  
   (2)add XXXResponse.java
   (3)add two method in DSClinet.java  
       public XXXResponse XXX(XXXRequest request) throws Exception {
           return this.XXXWithOptions(request, new RuntimeOptions());
       }
   public XXXResponse XXXWithOptions(XXXRequest request, RuntimeOptions 
runtime) throws Exception {
           Params params = new Params().setAction("XXX")
                   .setPathname("/dolphinscheduler/XXX")
           return TeaModel.toModel(this.doRequest(request, params, runtime), 
XXXResponse.class);
       }
   RuntimeOptions used to set http run time params, default is good enough
   
   
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to