Skip to content
广告❤️成为赞助商

介绍

主要功能 要内容 bug 异常 推送到 企业微信 飞书 钉钉 其他平台期待您的适配。

源码地址 aizuda-robot 测试demo

安装

  • Maven
xml
<dependency>
  <groupId>com.aizuda</groupId>
  <artifactId>aizuda-robot</artifactId>
  <version>1.0.0</version>
</dependency>
  • Gradle
xml
implementation 'com.aizuda:aizuda-robot:1.0.0'

机器人申请

企业微信机器人申请

钉钉机器人申请

飞书机器人申请

SpringBoot使用

  • application.yml 配置
# 企业微信 ,飞书 ,钉钉 三选一或者配置多个,不需要的配置必须删除
aizuda:
  robot:
    weChat:
      key: 自己申请
    dingTalk:
      accessToken: 自己申请
      secret: 自己申请
    feiShu:
      key: 自己申请
      secret: 自己申请
  • 制造一个异常测试
/**
 * http://localhost:8080/test
 * http://localhost:8080/test?param=0
 * http://localhost:8080/test?param=100
 * http://localhost:8080/test?param=123
 */
@GetMapping("test")
public Object test(Integer param) {
    //这里测试空指针
    if (null == param) {
        return param.intValue();
    }
    //这里测试除以0的异常
    if (0 == param) {
        return 1 / param;
    }
    if (100 == param) {
        return "运行成功";
    }
    throw new RuntimeException("运行时异常");
}

@Resource
private ISendException sendException;

@GetMapping("send")
public boolean send() {
    return sendException.send("手动发送一个异常");
}

属性说明

属性说明
weChat企业微信 ,包含子属性 key
dingTalk钉钉 ,包含子属性 accessToken ,secret
feiShu飞书 ,包含子属性 key , secret

每个人都是架构师