-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
base: master
Are you sure you want to change the base?
Changes from 6 commits
0f4a8fd
7f98cd7
8ef53aa
c83176d
cc2852c
a3eb188
f29f70a
f48a614
c601096
64a31dc
9b3f9ae
a02db9a
1fb93c3
bc3dd36
168a34c
2a810cf
3f70b91
71b935b
eb33ed0
0e59f70
a62dfc3
5df6758
9865aac
4a710c3
fb8c375
d923c60
22dce02
d9ab237
2bee5a0
0ed3221
130f2bd
5e1097d
b4ba734
c78c47e
81d5ac9
256ea5b
9c16e97
65de65e
4cc1108
89a9363
c91f209
79d951e
5d7335b
618e3da
e30854b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -110,6 +109,7 @@ public String createOrUpdate(final ApiDTO apiDTO) { | |
* @return update message | ||
*/ | ||
private String update(final ApiDTO apiDTO) { | ||
//cdbuild apiDO | ||
ApiDO apiDO = ApiDO.buildApiDO(apiDTO); | ||
final int updateRows = apiMapper.updateByPrimaryKeySelective(apiDO); | ||
if (updateRows > 0) { | ||
|
@@ -126,11 +126,6 @@ private String update(final ApiDTO apiDTO) { | |
tagRelationMapper.deleteByApiId(apiDO.getId()); | ||
tagRelationMapper.batchInsert(tags); | ||
} | ||
if (ApiStateEnum.PUBLISHED.getState() == apiDO.getState()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove this? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} | ||
|
@@ -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; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why add this?
There was a problem hiding this comment.
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