diff --git a/common/src/main/java/org/dromara/dynamictp/common/constant/LarkNotifyConst.java b/common/src/main/java/org/dromara/dynamictp/common/constant/LarkNotifyConst.java
index 9145dac1e..4e9642bf6 100644
--- a/common/src/main/java/org/dromara/dynamictp/common/constant/LarkNotifyConst.java
+++ b/common/src/main/java/org/dromara/dynamictp/common/constant/LarkNotifyConst.java
@@ -43,7 +43,7 @@ private LarkNotifyConst() { }
* lark at format. username
* 当配置username时,只能蓝色字体展示@username,被@人无@提醒
*/
- public static final String LARK_AT_FORMAT_USERNAME = "%s";
+ public static final String LARK_AT_FORMAT_USERNAME = "%s";
/**
* lark openid prefix
diff --git a/core/src/main/java/org/dromara/dynamictp/core/notifier/DtpLarkNotifier.java b/core/src/main/java/org/dromara/dynamictp/core/notifier/DtpLarkNotifier.java
index eca352621..2bac20543 100644
--- a/core/src/main/java/org/dromara/dynamictp/core/notifier/DtpLarkNotifier.java
+++ b/core/src/main/java/org/dromara/dynamictp/core/notifier/DtpLarkNotifier.java
@@ -70,7 +70,7 @@ protected Pair getColors() {
protected String formatReceivers(String receives) {
return Arrays.stream(receives.split(","))
.map(r -> StringUtils.startsWith(r, LARK_OPENID_PREFIX) ?
- String.format(LARK_AT_FORMAT_OPENID, r) : String.format(LARK_AT_FORMAT_USERNAME, r))
+ String.format(LARK_AT_FORMAT_OPENID, r) : String.format(LARK_AT_FORMAT_USERNAME, r, r))
.collect(Collectors.joining(" "));
}
}
diff --git a/test/test-core/src/test/java/org/dromara/dynamictp/test/core/notify/AbstractDtpNotifierTest.java b/test/test-core/src/test/java/org/dromara/dynamictp/test/core/notify/AbstractDtpNotifierTest.java
index 4485603d9..0e8780144 100644
--- a/test/test-core/src/test/java/org/dromara/dynamictp/test/core/notify/AbstractDtpNotifierTest.java
+++ b/test/test-core/src/test/java/org/dromara/dynamictp/test/core/notify/AbstractDtpNotifierTest.java
@@ -18,6 +18,7 @@
package org.dromara.dynamictp.test.core.notify;
import com.google.common.collect.Lists;
+import org.dromara.dynamictp.common.notifier.LarkNotifier;
import org.dromara.dynamictp.common.spring.ApplicationContextHolder;
import org.dromara.dynamictp.common.em.NotifyItemEnum;
import org.dromara.dynamictp.common.entity.NotifyItem;
@@ -28,6 +29,8 @@
import org.dromara.dynamictp.core.notifier.AbstractDtpNotifier;
import org.dromara.dynamictp.core.notifier.DtpDingNotifier;
import org.dromara.dynamictp.common.notifier.Notifier;
+import org.dromara.dynamictp.core.notifier.DtpLarkNotifier;
+import org.dromara.dynamictp.core.notifier.DtpNotifier;
import org.dromara.dynamictp.core.notifier.context.AlarmCtx;
import org.dromara.dynamictp.core.notifier.context.DtpNotifyCtxHolder;
import org.dromara.dynamictp.core.notifier.context.NoticeCtx;
@@ -118,4 +121,16 @@ public void testSendAlarmMsg() {
public void testGetQueueName2() {
Assert.assertEquals(dtpExecutor.getQueueType(), VARIABLE_LINKED_BLOCKING_QUEUE.getName());
}
+
+ @Test
+ public void testLarkSendChangeMsg() {
+ DtpNotifier larkNotifier = new DtpLarkNotifier(new LarkNotifier());
+ NotifyPlatform notifyPlatform = new NotifyPlatform();
+ notifyPlatform.setWebhook("");
+ notifyPlatform.setReceivers("");
+ TpMainFields oldFields = new TpMainFields();
+ List diffs = Lists.newArrayList("corePoolSize");
+ DtpNotifyCtxHolder.set(new NoticeCtx(ExecutorWrapper.of(dtpExecutor), new NotifyItem(), oldFields, diffs));
+ larkNotifier.sendChangeMsg(notifyPlatform, oldFields, diffs);
+ }
}