You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/12/07 08:30:38 UTC

[GitHub] [dolphinscheduler] zhongjiajie commented on a change in pull request #7210: Fix alert plugin instance filter (#7172)

zhongjiajie commented on a change in pull request #7210:
URL: https://github.com/apache/dolphinscheduler/pull/7210#discussion_r763745686



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java
##########
@@ -188,14 +188,20 @@ public boolean checkExistPluginInstanceName(String pluginInstanceName) {
     }
 
     @Override
-    public Result queryPluginPage(int pageIndex, int pageSize) {
-        IPage<AlertPluginInstance> pluginInstanceIPage = new Page<>(pageIndex, pageSize);
-        pluginInstanceIPage = alertPluginInstanceMapper.selectPage(pluginInstanceIPage, null);
+    public Result listPaging(User loginUser, String searchVal, int pageNo, int pageSize) {
 
-        PageInfo<AlertPluginInstanceVO> pageInfo = new PageInfo<>(pageIndex, pageSize);
-        pageInfo.setTotal((int) pluginInstanceIPage.getTotal());
-        pageInfo.setTotalList(buildPluginInstanceVOList(pluginInstanceIPage.getRecords()));
         Result result = new Result();
+        if (!isAdmin(loginUser)) {
+            putMsg(result,Status.USER_NO_OPERATION_PERM);
+            return result;
+        }
+
+        Page<AlertPluginInstance> page = new Page<>(pageNo, pageSize);
+        IPage<AlertPluginInstance> alertPluginInstanceIPage = alertPluginInstanceMapper.queryByInstanceNamePage(page, searchVal);
+
+        PageInfo<AlertPluginInstance> pageInfo = new PageInfo<>(pageNo, pageSize);
+        pageInfo.setTotal((int) alertPluginInstanceIPage.getTotal());
+        pageInfo.setTotalList(alertPluginInstanceIPage.getRecords());

Review comment:
       Delete what? 👀 




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org