ChatSend   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequestPath() 0 3 1
A getRequestMethod() 0 3 1
1
<?php
2
/**
3
 * This file is part of the mucts.com.
4
 *
5
 * This source file is subject to the MIT license that is bundled
6
 * with this source code in the file LICENSE.
7
 *
8
 * @version 1.0
9
 * @author herry<[email protected]>
10
 * @copyright © 2020  MuCTS.com All Rights Reserved.
11
 */
12
13
namespace MuCTS\Sobot\OnlineService;
14
15
16
use MuCTS\Sobot\Contracts\Sobot;
17
18
/**
19
 * Class ChatSend
20
 * 客户咨询客服
21
 *
22
 * 接口说明:
23
 * 接口类型:主动调用接口
24
 * 接口作用:可通过调用该接口以用户的身份给客服发送消息。
25
 *
26
 * @property-write string  $partnerid  企业自己的用户id,可自行传值
27
 * @property-write string $content  用户问题
28
 * @property-write string|null $msg_type  消息类型 (text,image,voice,默认为text纯文本,如果为image和voice的时候,content传递图片地址或者音频地址,其中音频支持mp3,wav两种格式)
29
 *
30
 * @method ChatSend partnerid(string $partnerid)  企业自己的用户id,可自行传值
31
 * @method ChatSend content(string $content)  用户问题
32
 * @method ChatSend msgType(string $msgType)  消息类型 (text,image,voice,默认为text纯文本,如果为image和voice的时候,content传递图片地址或者音频地址,其中音频支持mp3,wav两种格式)
33
 *
34
 * @package MuCTS\Sobot\OnlineService
35
 */
36
class ChatSend extends Sobot
37
{
38
    const MSG_TYPE_TEXT = 'text';
39
    const MSG_TYPE_IMAGE = 'image';
40
    const MSG_TYPE_VOICE = 'voice';
41
42
    public function getRequestMethod(): string
43
    {
44
        return self::METHOD_POST;
45
    }
46
47
    public function getRequestPath(): string
48
    {
49
        return '/api/chat/5/user/chat_send';
50
    }
51
}