Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: let open api more easier to use and development #3943

Conversation

Anilople
Copy link
Contributor

@Anilople Anilople commented Sep 2, 2021

What's the purpose of this PR

Let open api more easier to use and development.

Just a simple demo, not the final code.

Which issue(s) this PR fixes:

Fixes #3942

Brief changelog

Add interfaces ApolloXXXOpenApi under java package com.ctrip.framework.apollo.openapi.api.

Let controller under java package com.ctrip.framework.apollo.openapi.v1.controller implement each ApolloXXXOpenApi as server.

An interface ApolloOpenApi extends them all, let com.ctrip.framework.apollo.openapi.client.ApolloOpenApiClient implement ApolloOpenApi with compability.

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2021

Codecov Report

Merging #3943 (a4d2ff3) into master (8008a55) will decrease coverage by 0.02%.
The diff coverage is 25.19%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3943      +/-   ##
============================================
- Coverage     51.11%   51.09%   -0.03%     
- Complexity     2483     2489       +6     
============================================
  Files           476      481       +5     
  Lines         14681    14723      +42     
  Branches       1521     1521              
============================================
+ Hits           7504     7522      +18     
- Misses         6651     6674      +23     
- Partials        526      527       +1     
Impacted Files Coverage Δ
...ork/apollo/openapi/client/ApolloOpenApiClient.java 47.45% <0.00%> (ø)
...ollo/openapi/client/service/AppOpenApiService.java 46.66% <0.00%> (-1.61%) ⬇️
.../openapi/client/service/ClusterOpenApiService.java 93.10% <ø> (ø)
...llo/openapi/client/service/ItemOpenApiService.java 74.28% <ø> (ø)
...penapi/client/service/NamespaceOpenApiService.java 83.07% <ø> (ø)
.../openapi/client/service/ReleaseOpenApiService.java 82.00% <ø> (ø)
...ctrip/framework/apollo/portal/environment/Env.java 68.85% <ø> (ø)
...enapi/server/service/ServerItemOpenApiService.java 9.37% <9.37%> (ø)
...pi/server/service/ServerReleaseOpenApiService.java 18.75% <18.75%> (ø)
...k/apollo/openapi/v1/controller/ItemController.java 15.62% <25.00%> (+7.46%) ⬆️
... and 17 more

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 8008a55...a4d2ff3. Read the comment docs.

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! It looks good to me, would you please update the CHANGES.md?

@Anilople Anilople added the area/portal apollo-portal label Sep 14, 2021
@Anilople
Copy link
Contributor Author

Thanks for the contribution! It looks good to me, would you please update the CHANGES.md?

Done

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nobodyiam nobodyiam merged commit 2455c0f into apolloconfig:master Sep 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2021
@nobodyiam nobodyiam added this to the 1.10.0 milestone Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/openapi apollo-openapi area/portal apollo-portal enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

openapi design. client-server mode. let controller to implement interface
3 participants