UserUploadFile::getRequestMethod()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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\Cache;
17
use MuCTS\Sobot\Contracts\Sobot;
18
19
/**
20
 * Class UserUploadFile
21
 * 附件上传(客户)
22
 *
23
 * 接口说明:
24
 * 客户创建工单或回复工单时,上传一个或多个附件。
25
 * 先上传附件,再调用“创建工单(客户)”或者“回复工单(客户)”。
26
 *
27
 * @property-write string $file 文件流,选择要上传的文件
28
 * @property-write string $file_num_key 上传文件标识,随机生成的值,用于判断上传文件数量
29
 *
30
 * @method UserUploadFile file(string $file) 文件流,选择要上传的文件
31
 * @method UserUploadFile fileNumKey(string $fileNumKey) 上传文件标识,随机生成的值,用于判断上传文件数量
32
 * @package MuCTS\Sobot\Tickets
33
 */
34
class UserUploadFile extends Sobot
35
{
36
37
    public function getRequestMethod(): string
38
    {
39
        return self::METHOD_POST;
40
    }
41
42
    public function getRequestPath(): string
43
    {
44
        return '/api/ws/5/ticket/user_upload_file';
45
    }
46
47
    public function __construct(array $config, ?Cache $cache = null)
48
    {
49
        parent::__construct($config, $cache);
50
        $this->addHeader('Content-Type', 'multipart/form-data;boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
51
    }
52
}