From daa9d8eba1f2b36d7b094d9079948b081008059d Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Tue, 09 Apr 2024 17:37:12 +0800
Subject: [PATCH] 公告删除同步
---
src/main/java/org/springblade/modules/article/controller/ArticleController.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/main/java/org/springblade/modules/article/controller/ArticleController.java b/src/main/java/org/springblade/modules/article/controller/ArticleController.java
index 5965b10..4a3d43c 100644
--- a/src/main/java/org/springblade/modules/article/controller/ArticleController.java
+++ b/src/main/java/org/springblade/modules/article/controller/ArticleController.java
@@ -204,7 +204,18 @@
@ApiOperationSupport(order = 8)
@ApiOperation(value = "删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- return R.status(articleService.removeByIds(Func.toLongList(ids)));
+ List<Long> longs = Func.toLongList(ids);
+ boolean removeByIds = articleService.removeByIds(longs);
+ if (removeByIds){
+ for (Long id : longs) {
+ EsParam esParam = new EsParam();
+ esParam.setIndexName("test");
+ esParam.setTableName("jczz_article");
+ esParam.setTableId(id.toString());
+ elasticsearchDocumentService.removeByQuery(esParam);
+ }
+ }
+ return R.status(removeByIds);
}
/**
--
Gitblit v1.9.3