xy-message-center

module
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2022 License: MIT

README

XY.MessageCenter.DingTalk (迅游消息中心)

功能

日志

见: CHANGELOG.md

说明

  1. 环境变量及加密小工具见: tools
  2. 运行 ./xymessagecenter 默认使用配置文件目录下 ../etc/xymessagecenter.json
  3. 可以指定配置文件运行 ./xymessagecenter -c /mydir/conf.json
  4. 自动后台运行并守护自身, Warn 和守护日志在 log/daemon.log, 错误日志按天存放于 log 并发到日志接口
  5. 系统状态访问: http://api.domain:27779/sys/status JSON 格式, 可用于报警
  6. 心跳检查地址: http://api.domain:27779/heartbeat 返回字符串 OK, /ping 返回字符串 PONG

接口示例

1. 接口说明

接口完全按钉钉开发平台文档设计, 参数名大致相同, 详见接口文档.

1. 发送工作消息
POST /v1/dd/topapi/message HTTP/1.1
Host: api.domain:27779
Content-Type: application/json

{
    "userid_list": "0632500561850620,0632500561850621",
    "msg": {
        "msgtype": "text",
        "text": {
            "content": "工作消息测试"
        }
    }
}
2. 应答
{
    "id": 1,
    "ok": 1,
    "code": 0,
    "msg": "",
    "data": null,
    "count": 0
}
3. 错误应答示例
{
    "id": 0,
    "ok": 0,
    "code": 1,
    "msg": "群消息发送失败",
    "data": "[34014] 会话消息的json结构无效或不完整",
    "count": 0
}

okid 为 1 表示成功, 0 表示失败, code 相反, 0 表示成功, 1 表示失败

ff

Directories

Path Synopsis
cli
sys
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL