DingMessageServiceInterface.php 1.7 KB
Newer Older
1 2 3 4 5 6 7 8
<?php
/**
 * Created by PhpStorm.
 * User: 姜克保
 * Date: 2020/5/20
 * Time: 15:48
 */

9
namespace Meibuyu\Rpc\Service\Interfaces\Message\DingTalk;
jiangkebao's avatar
jiangkebao committed
10

11 12 13
interface DingMessageServiceInterface
{

jiangkebao's avatar
jiangkebao committed
14 15 16 17 18
    /**
     * 发送普通消息
     *
     * @param string $sender 消息发送者 userId
     * @param string $cid 群会话或者个人会话的id,通过JSAPI接口唤起联系人界面选择会话获取会话cid;小程序参考获取会话信息,H5微应用参考获取会话信息
19
     * @param array $message 消息内容,消息类型和样例可参考“消息类型与数据格式”文档。最长不超过2048个字节
jiangkebao's avatar
jiangkebao committed
20 21 22 23 24 25 26 27
     *
     * @return mixed
     */
    public function sendGeneralMessage($sender, $cid, $message);

    /**
     * 发送工作通知消息
     * @param array $params
jiangkebao's avatar
jiangkebao committed
28 29 30 31 32 33
     * 发送给多个用户userid_list userid用逗号分隔
     * ['userid_list' => "016740060622772430,251201234433774424",'msg' => '钉钉消息测试','msgtype' => 'text'];
     * 发送给所有人
     * ['dept_id_list' => "1,2",'msg' => '钉钉消息测试','msgtype' => 'text'];
     * 发送给多个部门 部门用逗号分隔
     * ['to_all_user' => "true",'msg' => '钉钉消息测试','msgtype' => 'text'];
jiangkebao's avatar
jiangkebao committed
34 35 36 37 38 39 40 41 42 43
     * @return mixed
     */
    public function sendCorporationMessage($params);

    /**
     * @param int $taskId
     *
     * @return mixed
     */
    public function corporationMessage($taskId);
44

45 46 47 48 49 50 51 52
    /**
     * 发送text钉钉消息
     * @param integer $templateId 模板id
     * @param array $replace 替换内容(注意顺序)
     * @param array $userIds 用户id(这个是微服务用户的id)
     * @return mixed
     */
    public function sendTextMessage($templateId, $replace, $userIds);
53
}