Commit f503fe06 authored by 王雷's avatar 王雷

修改README.md

parent 11d13bfe
![Release Version](https://img.shields.io/badge/version-1.0.0-orange.svg) ![Platform](https://img.shields.io/badge/Platform-%20Android-blue.svg) ![Release Version](https://img.shields.io/badge/version-1.0.0-orange.svg) ![Platform](https://img.shields.io/badge/Platform-%20Android-blue.svg)
# 钉钉机器人 # webSocket
1. 基于[源项目 RxWebSocket]([dhhAndroid/RxWebSocket at 2.x (github.com)](https://github.com/dhhAndroid/RxWebSocket/tree/2.x))进行改造 1. 基于[源项目 RxWebSocket]([dhhAndroid/RxWebSocket at 2.x (github.com)](https://github.com/dhhAndroid/RxWebSocket/tree/2.x))进行改造
...@@ -17,55 +17,9 @@ Gradle: ...@@ -17,55 +17,9 @@ Gradle:
## 使用 ## 使用
```kotlin ```kotlin
// debug Boolean 是否打开调试 参考 WebSocketClientService.kt
// 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` 属性为固定类型,需要业务方自己集成此类,扩展更多属性。 v1.0.0 版本移除 emitter.setCancellable方法 ,实测发现socket断连后,自动重连机制起做作用后,重新创建的 webSocket会被emitter.setCancellable 方法关闭
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