fix:钉钉消息

This commit is contained in:
xiang
2025-07-29 22:35:13 +08:00
parent 6eabd62cb0
commit 2a39de6a28

View File

@@ -62,8 +62,13 @@ public class DingTalkService {
*/ */
private static final String SECRET = "SEC768ed578c0fb31a9aec84b1c1db4f195f5aca203985bbb9d549e23e41c8874d1"; private static final String SECRET = "SEC768ed578c0fb31a9aec84b1c1db4f195f5aca203985bbb9d549e23e41c8874d1";
/**
public static String sendRobotMessage(String msg) throws Exception { * 发送机器人消息
* @param msg
* @return
* @throws Exception
*/
public String sendRobotMessage(String msg) throws Exception {
Long timestamp = System.currentTimeMillis(); Long timestamp = System.currentTimeMillis();
String stringToSign = timestamp + "\n" + SECRET; String stringToSign = timestamp + "\n" + SECRET;
Mac mac = Mac.getInstance("HmacSHA256"); Mac mac = Mac.getInstance("HmacSHA256");
@@ -91,10 +96,6 @@ public class DingTalkService {
return rsp.getBody(); return rsp.getBody();
} }
public static void main(String[] args) throws Exception {
System.out.println(DingTalkService.sendRobotMessage("机器人测试"));
}
/** /**
* 发送消息到企业群 * 发送消息到企业群
* *