Skip to content

[Feature-7946] add java sdk#8946

Closed
zwZjut wants to merge 7 commits intoapache:2.0.6-preparefrom
zwZjut:2.0.6-prepare
Closed

[Feature-7946] add java sdk#8946
zwZjut wants to merge 7 commits intoapache:2.0.6-preparefrom
zwZjut:2.0.6-prepare

Conversation

@zwZjut
Copy link
Contributor

@zwZjut zwZjut commented Mar 17, 2022

Purpose of the pull request

#7946

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

@zwZjut zwZjut changed the base branch from dev to 2.0.6-prepare March 17, 2022 03:04
@caishunfeng caishunfeng changed the title #7946: add java sdk [Feature-7946] add java sdk Mar 17, 2022
@zwZjut
Copy link
Contributor Author

zwZjut commented Mar 17, 2022

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 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"); // (1) token; (2) endpoint
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

@caishunfeng caishunfeng added Waiting for review Waiting for review miss:docs missing documents in PR labels Mar 17, 2022
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (2.0.6-prepare@e2b962e). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 54db739 differs from pull request most recent head ee0b876. Consider uploading reports for the commit ee0b876 to get more accurate results

@@               Coverage Diff                @@
##             2.0.6-prepare    #8946   +/-   ##
================================================
  Coverage                 ?   21.04%           
  Complexity               ?     1591           
================================================
  Files                    ?      536           
  Lines                    ?    22525           
  Branches                 ?     2673           
================================================
  Hits                     ?     4740           
  Misses                   ?    17300           
  Partials                 ?      485           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2b962e...ee0b876. Read the comment docs.

@sonarqubecloud
Copy link

@zhuangchong
Copy link
Contributor

Please commit to the dev branch.

@zwZjut
Copy link
Contributor Author

zwZjut commented Mar 25, 2022

Please commit to the dev branch.

The dev branch has changed too much. At present, I am not optimistic about the overall packaging and construction method of dev branch, which is not conducive to users' simple use. The interface implemented has been tested of branch 2.0.x and there is no plan to join dev at present

@sonarqubecloud
Copy link

@zwZjut zwZjut deleted the branch apache:2.0.6-prepare June 28, 2022 02:24
@zwZjut zwZjut closed this Jun 28, 2022
@zwZjut zwZjut deleted the 2.0.6-prepare branch June 28, 2022 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

miss:docs missing documents in PR Waiting for review Waiting for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants