Completed
Push — master ( 4723bf...a2e0e2 )
by mingyoung
18s queued 13s
created

Client   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A listByUserId() 0 3 1
A create() 0 3 1
A update() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the mingyoung/dingtalk.
5
 *
6
 * (c) 张铭阳 <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyDingTalk\Schedule;
13
14
use EasyDingTalk\Kernel\BaseClient;
15
16
class Client extends BaseClient
17
{
18
    /**
19
     * 发起待办
20
     *
21
     * @param array $params
22
     *
23
     * @return mixed
24
     */
25
    public function create($params)
26
    {
27
        return $this->client->postJson('topapi/workrecord/add', $params);
28
    }
29
30
    /**
31
     * 更新待办
32
     *
33
     * @param string $userId
34
     * @param string $recordId
35
     *
36
     * @return mixed
37
     */
38
    public function update($userId, $recordId)
39
    {
40
        return $this->client->postJson('topapi/workrecord/add', ['userid' => $userId, 'record_id' => $recordId]);
41
    }
42
43
    /**
44
     * 获取用户待办事项
45
     *
46
     * @param string $userId
47
     * @param int    $status
48
     * @param int    $offset
49
     * @param int    $limit
50
     *
51
     * @return mixed
52
     */
53
    public function listByUserId($userId, $status, $offset, $limit)
54
    {
55
        return $this->client->postJson('topapi/workrecord/getbyuserid', compact('status', 'offset', 'limit') + ['userid' => $userId]);
56
    }
57
}
58