moremind commented on code in PR #5740:
URL: https://github.com/apache/shenyu/pull/5740#discussion_r1822759314


##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/NamespaceServiceImpl.java:
##########
@@ -55,12 +66,32 @@ public class NamespaceServiceImpl implements 
NamespaceService {
 
     private PluginService pluginService;
 
+    private SelectorMapper selectorMapper;

Review Comment:
   pls use private final xxxService/Mapper xxservice/xxmapper



##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/NamespaceServiceImpl.java:
##########
@@ -83,10 +114,35 @@ public String delete(final List<String> ids) {
         if (ids.contains(Constants.DEFAULT_NAMESPACE_PRIMARY_KEY)) {
             return AdminConstants.SYS_DEFAULT_NAMESPACE_ID_DELETE;
         }
-        List<NamespaceDO> namespaceDOS = namespaceMapper.selectByIds(ids);
-        if (CollectionUtils.isEmpty(namespaceDOS)) {
+        Optional<NamespaceDO> namespaceDOS = 
namespaceMapper.selectByIds(ids).stream().findFirst();

Review Comment:
   this is batch operation, not findFirst



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