From 123c79787c71593985d46abd692b145f7d64a727 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Mon, 22 Jan 2024 16:45:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E4=BB=BB=E5=8A=A1=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=89=8D=E5=88=A4=E6=96=ADpulsar=20topic=E5=92=8Curl?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/web/controller/TaskController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/TaskController.java b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/TaskController.java index d5d4f2e..cff4134 100644 --- a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/TaskController.java +++ b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/TaskController.java @@ -47,8 +47,14 @@ public class TaskController { boolean scanQueue = StrUtil.contains(mode, "queue"); boolean scanLog = StrUtil.contains(mode, "log"); boolean scanBase = StrUtil.contains(mode, "base"); - if (scanQueue && (StrUtil.isBlank(topic) || StrUtil.isBlank(pulsar))) { - throw new RuntimeException("Pulsar topic or url cannot be empty"); + if (scanQueue) { + if (StrUtil.isBlank(topic) || StrUtil.isBlank(pulsar)) { + throw new RuntimeException("Pulsar topic or url cannot be empty"); + } else { + if (!pulsarService.existsTopic(pulsar, topic)) { + throw new RuntimeException("Pulsar url is not contain the topic"); + } + } } if ((scanLog || scanBase) && StrUtil.isBlank(hdfs)) { throw new RuntimeException("Hdfs path cannot be empty");