dragon-zhang commented on code in PR #4263:
URL: https://github.com/apache/shenyu/pull/4263#discussion_r1047003552


##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/ApiServiceImpl.java:
##########
@@ -175,4 +175,25 @@ public CommonPager<ApiVO> listByPage(final ApiQuery 
apiQuery) {
                     return ApiVO.buildApiVO(item, tagVOS);
                 }).collect(Collectors.toList()));
     }
+
+    @Override
+    public int deleteByApiPathHttpMethodRpcType(final String apiPath, final 
Integer httpMethod, final String rpcType) {
+        List<ApiDO> apiDOs = 
apiMapper.selectByApiPathHttpMethodRpcType(apiPath, httpMethod, rpcType);
+        // delete apis.
+        if (CollectionUtils.isNotEmpty(apiDOs)) {
+            final List<String> apiIds = ListUtil.map(apiDOs, ApiDO::getId);
+            final int deleteRows = this.apiMapper.deleteByIds(apiIds);
+            if (deleteRows > 0) {
+                tagRelationMapper.deleteByApiIds(apiIds);
+            }
+            return deleteRows;
+        }
+        return 0;
+    }
+
+    @Override
+    public String offlineByContextPath(final String contextPath) {
+        apiMapper.updateOfflineByContextPath(contextPath);

Review Comment:
   There are many nodes in the service. Only when all nodes are offline can the 
API status be updated.



-- 
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