# dingtalk-robot-reporter **Repository Path**: cool-moon/dingtalk-robot-reporter ## Basic Information - **Project Name**: dingtalk-robot-reporter - **Description**: 开发过程中有些事件需要报告人工,及时发现问题, 此组件上报问题到钉钉机器人 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-12-07 - **Last Updated**: 2021-05-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 使用 * 引入依赖 ``` top.cmoon.component dingtalk-robot-client 0.2-SNAPSHOT ``` * 配置 application-{profile}.yml ``` reporter: dingtalk: robot: endpoint=https://oapi.dingtalk.com/robot/send robots: - isDefault: true key: default_robot # 自己定义,方便使用 name: 线上问题自动提示群 accessToken: *** # 钉钉accesstoken secret: *** # 钉钉签名 - key: test_robot_1 name: 线上问题测试群 accessToken: *** secret: *** ``` * 代码 ``` public void sendReport(){ // 发送到默认机器人 ReportTextEvent event = ReportTextEvent.builder() .content("集成测试消息发送第一条 " + new Date()) .build(); applicationContext.publishEvent(event); // 发送到指定机器人: test_robot_1 event = ReportTextEvent.builder() .robotKey("test_robot_1") .content("[集成测试消息发送第二条 " + new Date()) .build(); applicationContext.publishEvent(event); } ``` ### 版本变化 * **0.2-SNAPSHOT** 1. 支持发送信息到指定机器人