Skip to content

Commit 12eac2f

Browse files
author
xinzhifu
committed
webhook 最终修改版本
1 parent 54f109b commit 12eac2f

File tree

3 files changed

+4
-197
lines changed

3 files changed

+4
-197
lines changed

springboot-webhook-wechat/src/main/java/com/xiaofu/webhook/controller/WebhookController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public String webhookGithub(@RequestBody GithubWebhookPullVo webhook) {
6363
StringBuffer sb = new StringBuffer();
6464
SimpleDateFormat simpleFormatter = new SimpleDateFormat("yyyy-MM-dd");
6565
String now = simpleFormatter.format(new Date());
66-
sb.append("时间:" + now + "\t");
67-
sb.append("提交者:" + senderUser.getName() + "\t");
68-
sb.append("向作者" + ownerUser.getName() + "远程仓库" + name + "提交代码" + "\t");
66+
sb.append("提交者:[" + senderUser.getName() + "]");
67+
sb.append(":" + now);
68+
sb.append("向作者:[" + ownerUser.getName() + "]的,远程仓库" + name + "提交代码");
6969

7070
WeChatWebhook weChatWebhook = new WeChatWebhook();
7171
weChatWebhook.setMsgtype("text");
@@ -78,6 +78,7 @@ public String webhookGithub(@RequestBody GithubWebhookPullVo webhook) {
7878
/**
7979
* 组装参数后向企业微信发送webhook请求
8080
*/
81+
log.info("企业微信发送参数 {}", JSON.toJSONString(weChatWebhook));
8182
String post = HttpUtil.sendPostJsonBody(WECHAT_URL, JSON.toJSONString(weChatWebhook));
8283
log.info("企业微信发送结果 post {}", post);
8384
return JSON.toJSONString(post);

springboot-webhook-wechat/target/classes/application.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

springboot-webhook-wechat/target/classes/templates/index.html

Lines changed: 0 additions & 193 deletions
This file was deleted.

0 commit comments

Comments
 (0)