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

[type:refactor]Decouple apidoc module from rule and selector modules #5685

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Changes from 6 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0f4a8fd
refactor admin : decouple apidoc from rule and selector
478320 Sep 29, 2024
7f98cd7
refactor admin : decouple apidoc from rule and selector
478320 Sep 29, 2024
8ef53aa
Merge branch 'feat_decouple_api_rule_select' of https://github.com/47…
478320 Oct 1, 2024
c83176d
refactor admin : remove unused imports
478320 Oct 1, 2024
cc2852c
trigger ci
478320 Oct 8, 2024
a3eb188
Merge branch 'master' into feat_decouple_api_rule_select
yu199195 Oct 9, 2024
f29f70a
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 10, 2024
f48a614
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 11, 2024
c601096
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 11, 2024
64a31dc
Merge branch 'master' into feat_decouple_api_rule_select
478320 Oct 12, 2024
9b3f9ae
refactor admin : remove unnecessary annotations.
478320 Oct 12, 2024
a02db9a
Merge branch 'feat_decouple_api_rule_select' of https://github.com/47…
478320 Oct 12, 2024
1fb93c3
Merge branch 'master' into feat_decouple_api_rule_select
478320 Oct 12, 2024
bc3dd36
Merge branch 'master' into feat_decouple_api_rule_select
478320 Oct 13, 2024
168a34c
Merge branch 'master' into feat_decouple_api_rule_select
478320 Oct 14, 2024
2a810cf
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 15, 2024
3f70b91
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 16, 2024
71b935b
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 17, 2024
eb33ed0
Merge branch 'master' into feat_decouple_api_rule_select
478320 Oct 20, 2024
0e59f70
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 23, 2024
a62dfc3
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 24, 2024
5df6758
Merge branch 'master' into feat_decouple_api_rule_select
478320 Oct 25, 2024
9865aac
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 25, 2024
4a710c3
Merge branch 'master' into feat_decouple_api_rule_select
478320 Oct 25, 2024
fb8c375
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 26, 2024
d923c60
Merge branch 'master' into feat_decouple_api_rule_select
478320 Oct 27, 2024
22dce02
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 29, 2024
d9ab237
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 29, 2024
2bee5a0
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Oct 31, 2024
0ed3221
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 3, 2024
130f2bd
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 4, 2024
5e1097d
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 4, 2024
b4ba734
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 5, 2024
c78c47e
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 5, 2024
81d5ac9
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 5, 2024
256ea5b
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 6, 2024
9c16e97
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 6, 2024
65de65e
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 7, 2024
4cc1108
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 7, 2024
89a9363
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 8, 2024
c91f209
Merge branch 'master' into feat_decouple_api_rule_select
478320 Nov 12, 2024
79d951e
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 12, 2024
5d7335b
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 12, 2024
618e3da
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 13, 2024
e30854b
Merge branch 'master' into feat_decouple_api_rule_select
Aias00 Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.apache.shenyu.admin.utils.ShenyuResultMessage;
import org.apache.shenyu.common.constant.AdminConstants;
import org.apache.shenyu.common.dto.RuleData;
import org.apache.shenyu.common.enums.ApiStateEnum;
import org.apache.shenyu.common.utils.GsonUtils;
import org.apache.shenyu.common.utils.UUIDUtils;
import org.apache.shenyu.register.common.dto.ApiDocRegisterDTO;
Expand Down Expand Up @@ -110,6 +109,7 @@ public String createOrUpdate(final ApiDTO apiDTO) {
* @return update message
*/
private String update(final ApiDTO apiDTO) {
//cdbuild apiDO
Copy link
Member

Choose a reason for hiding this comment

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

why add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello, my previous submission failed to check the instability of ci. I hope I can re-trigger ci through some modifications. If these modifications cause bad effects, I will delete them

ApiDO apiDO = ApiDO.buildApiDO(apiDTO);
final int updateRows = apiMapper.updateByPrimaryKeySelective(apiDO);
if (updateRows > 0) {
Expand All @@ -126,11 +126,6 @@ private String update(final ApiDTO apiDTO) {
tagRelationMapper.deleteByApiId(apiDO.getId());
tagRelationMapper.batchInsert(tags);
}
if (ApiStateEnum.PUBLISHED.getState() == apiDO.getState()) {
Copy link
Member

Choose a reason for hiding this comment

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

why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When creating apidoc, this part determines whether the document is in the published state, and if the document is in the published state, the selector is registered, etc. If it is in the offline state, the corresponding selector content is deleted, which will lead to the coupling of apidoc and selector. Deleting this part can release their coupling. The removal of this feature will have the following effects, the document publication and logout will only be displayed as a status without additional functions, the document logout and online need to manually add and delete selectors and other content, for the creation of api documents, Users using @RequestMapping and other annotations and users using swagger will automatically create selectors and other content through annotations, which will not affect the convenience brought by automation. To add api documents in the visual interface, you need to manually create corresponding selector, rule, and Metadata. For the offline api document, all users need to manually delete the corresponding selector, rule, and Metadata

register(apiDO);
} else if (ApiStateEnum.OFFLINE.getState() == apiDO.getState()) {
removeRegister(apiDO);
}
}
return ShenyuResultMessage.UPDATE_SUCCESS;
}
Expand Down Expand Up @@ -158,9 +153,6 @@ private String create(final ApiDTO apiDTO) {
.build()).collect(Collectors.toList());
tagRelationMapper.batchInsert(tags);
}
if (ApiStateEnum.PUBLISHED.getState() == apiDO.getState()) {
register(apiDO);
}
}
return ShenyuResultMessage.CREATE_SUCCESS;
}
Expand Down
Loading