Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RxWebSocket
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Android Widget
RxWebSocket
Commits
f503fe06
Commit
f503fe06
authored
Mar 30, 2022
by
王雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改README.md
parent
11d13bfe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
49 deletions
+3
-49
README.md
README.md
+3
-49
No files found.
README.md
View file @
f503fe06




#
钉钉机器人
#
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 方法关闭
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment