Completed
Push — master ( 8010b8...47913b )
by mingyoung
03:09
created

Client   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 48
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setVisibility() 0 3 1
A list() 0 3 1
A listByUserId() 0 4 1
A getVisibility() 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\Microapp;
13
14
use EasyDingTalk\Kernel\BaseClient;
15
16
class Client extends BaseClient
17
{
18
    /**
19
     * 获取应用列表
20
     *
21
     * @return mixed
22
     */
23
    public function list()
24
    {
25
        return $this->client->postJson('microapp/list');
26
    }
27
28
    /**
29
     * 获取员工可见的应用列表
30
     *
31
     * @param string $userId
32
     *
33
     * @return mixed
34
     */
35
    public function listByUserId($userId)
36
    {
37
        return $this->client->get('microapp/list_by_userid', [
38
            'userid' => $userId,
39
        ]);
40
    }
41
42
    /**
43
     * 获取应用的可见范围
44
     *
45
     * @param int $agentId
46
     *
47
     * @return mixed
48
     */
49
    public function getVisibility($agentId)
50
    {
51
        return $this->client->postJson('microapp/visible_scopes', compact('agentId'));
52
    }
53
54
    /**
55
     * 设置应用的可见范围
56
     *
57
     * @param array $params
58
     *
59
     * @return mixed
60
     */
61
    public function setVisibility($params)
62
    {
63
        return $this->client->postJson('microapp/set_visible_scopes', $params);
64
    }
65
}
66