1、通过钉钉群添加一个机器人
2、代码实现
java
/**
* 发钉钉审核.
*
* @param
*/
private void sendDingDing(String tableName) {
String url = "https://oapi.dingtalk.com/robot/send?access_token=229c627d05a3157f79a5ef1942d29c4dfb4515bf5c0ad65e3c69423bc016f97c";
JSONObject msg = new JSONObject();
msg.set("at", new JSONObject().set("isAtAll", true));
msg.set("text", new JSONObject().set("content", "采购单:拦截器启动成功!!!"));
msg.set("msgtype", "text");
String json = JSONUtil.toJsonStr(msg);
String result = HttpRequest.post(url)
.body(json)
.execute().body();
log.debug("采购单{},发送邮件审核成功", tableName);
}