|
|
@@ -1,19 +1,11 @@
|
|
|
#!/usr/bin/env groovy
|
|
|
import groovy.json.JsonOutput
|
|
|
-import org.feishu.SignUtil
|
|
|
|
|
|
-def send(String webhook, String secret, Map card) {
|
|
|
- Long ts = System.currentTimeMillis() / 1000
|
|
|
- String sign = SignUtil.genSign(secret, ts)
|
|
|
- def body = [
|
|
|
- timestamp: ts,
|
|
|
- sign : sign,
|
|
|
- msg_type : "interactive",
|
|
|
- card : card
|
|
|
- ]
|
|
|
+def send(String webhook, Map card) {
|
|
|
+ // 不带签名,直接发
|
|
|
httpRequest(
|
|
|
httpMode: 'POST',
|
|
|
- requestBody: JsonOutput.toJson(body),
|
|
|
+ requestBody: JsonOutput.toJson([msg_type: 'interactive', card: card]),
|
|
|
contentType: 'APPLICATION_JSON',
|
|
|
url: webhook,
|
|
|
consoleLogResponseBody: true,
|