fix(send): extract webhook_url from JSON ext_info for WECOM_BOT
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user