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

namespace Meibuyu\Micro\Service\Interfaces\DingTalk;

jiangkebao's avatar
jiangkebao committed
11 12
use phpDocumentor\Reflection\Types\Mixed_;

13 14 15
interface DingMessageServiceInterface
{

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


    /**
     * 发送工作通知消息
     * @param array $params
jiangkebao's avatar
jiangkebao committed
31 32 33 34 35 36
     * 发送给多个用户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
37 38 39 40 41 42 43 44 45 46
     * @return mixed
     */
    public function sendCorporationMessage($params);

    /**
     * @param int $taskId
     *
     * @return mixed
     */
    public function corporationMessage($taskId);
47 48 49 50 51 52 53 54 55

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