You need to sign in or sign up before continuing.
Commit 11d13bfe authored by 王雷's avatar 王雷

新增README.md

parent 67c2d1ea
![Release Version](https://img.shields.io/badge/version-1.0.0-orange.svg) ![Platform](https://img.shields.io/badge/Platform-%20Android-blue.svg)
# 钉钉机器人
1. 基于[源项目 RxWebSocket]([dhhAndroid/RxWebSocket at 2.x (github.com)](https://github.com/dhhAndroid/RxWebSocket/tree/2.x))进行改造
Gradle:
```groovy
implementation "com.qmai.android.socket:rxwebSocket:1.0.0"
```
## 使用
```kotlin
// debug Boolean 是否打开调试
// token String 创建机器人时Webhook地址后面的token
// title String 消息标题
// content String 消息内容,目前支持markdown格式的内容
DDRobot.sendMsg(debug = true, token = token, title = title, content = content)
.catch { ToastUtils.showShort("发送失败") }
.collect {
ToastUtils.showShort("发送成功")
}
/****
* 自定义上传到钉钉
* @param token token
* @param type 上传类型
* @param customParams 自定义参数 返回MutableMap
* @param callback 请求结果回调
*/
fun sendCustomMsg(
token: String,
type: String,
customParams: () -> MutableMap<String, String>,
callback: ((String?) -> Unit)? = null
)
/***
* @desc 发送信息到我们服务端
* @param baseInfo 传入的信息 需自己集成此类 扩展更多信息
* @param callback 回调
*@param debug 是否显示日志
*/
fun sendQmLog(
baseInfo: BaseLogInfoBean,
callback: ((String?) -> Unit)? = null,
debug: Boolean = false
)
/***
* @param baseInfo 自定义json消息
* @param callback 回调
* @param debug 调试开关
*/
fun sendCustomJsonQmLog(
baseInfo: String,
callback: ((String?) -> Unit)? = null,
debug: Boolean = false
)
```
## 说明
`DDRobot.sendQmLog()``BaseLogInfoBean` 属性为固定类型,需要业务方自己集成此类,扩展更多属性。
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment