fix(send): extract webhook_url from JSON ext_info for WECOM_BOT

This commit is contained in:
2026-07-15 13:35:44 +08:00
parent 168cd2de11
commit 0ad12c6df6
3 changed files with 41 additions and 4 deletions

View File

@@ -791,6 +791,22 @@ public class SendService {
}
}
@SuppressWarnings("unchecked")
private String extractWeComBotWebhookUrl(String extInfo) {
if (!StringUtils.hasText(extInfo)) {
return null;
}
try {
Map<String, Object> parsed = JsonUtils.fromJson(extInfo, Map.class);
if (parsed != null && parsed.get("webhook_url") != null) {
return String.valueOf(parsed.get("webhook_url"));
}
} catch (Exception e) {
// fallback: treat legacy ext_info as plain URL string
}
return extInfo;
}
private RetryConfig loadRetryConfig(String tenantCode, SendRequest request) {
String channelTypeStr = extractChannelType(request.getChannelStrategy());
PolicyGroup policyGroup = loadPolicyGroup(tenantCode, channelTypeStr);
@@ -989,7 +1005,7 @@ public class SendService {
}
if (account.getAccountType() != null && account.getAccountType() == AccountType.WECOM_BOT.getCode()
&& StringUtils.hasText(account.getExtInfo())) {
extra.put("webhook_url", account.getExtInfo());
extra.put("webhook_url", extractWeComBotWebhookUrl(account.getExtInfo()));
}
}
extra.put("record_id", record.getId());