SaveUserTicket   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 11
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\Tickets;
14
15
16
use MuCTS\Sobot\Contracts\Sobot;
17
18
/**
19
 * Class SaveUserTicket
20
 * 创建工单(客户)
21
 *
22
 * 1)调用此接口,系统会根据提交的参数按此优先级“客户ID > 对接ID > 客户邮箱 > 客户手机号”查找客户,如果匹配成功,用该客户作为工单关联客户,否则新建客户后关联。
23
 * 备注:
24
 * 1、此处所传工单自定义字段,必须是所传工单分类id关联工单模板中的自定义字段。
25
 * 2、分类关联模板中的自定义字段通过“查询工单分类关联的工单模板信息“接口获取。
26
 * 3、工单分类ID需要调用“查询数据字典”中工单分类获取具体值。
27
 * 4、如需上传附件,需要调用“附件上传(客户)”进行。
28
 *
29
 * @property-write string $companyid 企业ID
30
 * @property-write string $partnerid 对接ID
31
 * @property-write string $ticket_title 工单标题
32
 * @property-write string $userid 客户ID
33
 * @property-write string $ticket_content 工单问题描述
34
 * @property-write string $user_emails 客户邮箱
35
 * @property-write string $user_tels 客户电话
36
 * @property-write string $ticket_typeid 工单分类ID,叶子节点的分类ID
37
 * @property-write int $ticket_from 工单来源,1 PC客户留言,2 H5客户留言,3 微信公众号客户留言,4 APP客户留言,12 邮件留言,13语音留言,16微信小程序客户留言,17企业微信客户留言
38
 * @property-write string $file_str 附件路径,多个附件,附件之间采用英文分号";"隔开
39
 * @property-write array $extend_fields 工单自定义字段信息,格式:[["fieldid"=>"自定义字段ID","field_value"=>"自定义字段值"]]
40
 *
41
 * @method SaveUserTicket companyid(string $companyid) 企业ID
42
 * @method SaveUserTicket ticketTitle(string $ticketTitle) 工单标题
43
 * @method SaveUserTicket userid(string $userid) 客户ID
44
 * @method SaveUserTicket partnerid(string $partnerid) 对接ID
45
 * @method SaveUserTicket ticketContent(string $ticketContent) 工单问题描述
46
 * @method SaveUserTicket userEmails(string $userEmails) 客户邮箱
47
 * @method SaveUserTicket userTels(string $userTels) 客户电话
48
 * @method SaveUserTicket ticketTypeid(string $ticketTypeid) 工单分类ID,叶子节点的分类ID
49
 * @method SaveUserTicket ticketFrom(string $ticketFrom) 工单来源,1 PC客户留言,2 H5客户留言,3 微信公众号客户留言,4 APP客户留言,12 邮件留言,13语音留言,16微信小程序客户留言,17企业微信客户留言
50
 * @method SaveUserTicket fileStr(string $fileStr) 附件路径,多个附件,附件之间采用英文分号";"隔开
51
 * @method SaveUserTicket extendFields(array $extendFields) 工单自定义字段信息,格式:[["fieldid"=>"自定义字段ID","field_value"=>"自定义字段值"]]
52
 * @method SaveUserTicket pushExtendFieldsItem(string $fieldid, string $fieldValue) 追加工单自定义字段信息
53
 * @package MuCTS\Sobot\Tickets
54
 */
55
class SaveUserTicket extends Sobot
56
{
57
58
    public function getRequestMethod(): string
59
    {
60
        return self::METHOD_POST;
61
    }
62
63
    public function getRequestPath(): string
64
    {
65
        return '/api/ws/5/ticket/save_user_ticket';
66
    }
67
}