Passed
Pull Request — master (#1663)
by
unknown
04:37 queued 23s
created

Client::setFinishPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[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 EasyWeChat\OfficialAccount\WiFi;
13
14
use EasyWeChat\Kernel\BaseClient;
15
16
/**
17
 * Class Client.
18
 *
19
 * @author her-cat <[email protected]>
20
 */
21
class Client extends BaseClient
22
{
23
    /**
24
     * Get Wi-Fi statistics.
25
     *
26
     * @param string $beginDate
27
     * @param string $endDate
28
     * @param int    $shopId
29
     *
30
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
31
     *
32
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
33
     * @throws \GuzzleHttp\Exception\GuzzleException
34
     */
35 1
    public function summary(string $beginDate, string $endDate, int $shopId = -1)
36
    {
37
        $data = [
38 1
            'begin_date' => $beginDate,
39 1
            'end_date' => $endDate,
40 1
            'shop_id' => $shopId,
41
        ];
42
43 1
        return $this->httpPostJson('bizwifi/statistics/list', $data);
44
    }
45
46
    /**
47
     * Get the material QR code.
48
     *
49
     * @param int    $shopId
50
     * @param string $ssid
51
     * @param int    $type
52
     *
53
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
54
     *
55
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
56
     * @throws \GuzzleHttp\Exception\GuzzleException
57
     */
58 1
    public function getQrCodeUrl(int $shopId, string $ssid, int $type = 0)
59
    {
60
        $data = [
61 1
            'shop_id' => $shopId,
62 1
            'ssid' => $ssid,
63 1
            'img_id' => $type,
64
        ];
65
66 1
        return $this->httpPostJson('bizwifi/qrcode/get', $data);
67
    }
68
69
    /**
70
     * Wi-Fi completion page jump applet.
71
     *
72
     * @param array $data
73
     *
74
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
75
     *
76
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
77
     * @throws \GuzzleHttp\Exception\GuzzleException
78
     */
79 1
    public function setFinishPage(array $data)
80
    {
81 1
        return $this->httpPostJson('bizwifi/finishpage/set', $data);
82
    }
83
84
    /**
85
     * Set the top banner jump applet.
86
     *
87
     * @param array $data
88
     *
89
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
90
     *
91
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
92
     * @throws \GuzzleHttp\Exception\GuzzleException
93
     */
94 1
    public function setHomePage(array $data)
95
    {
96 1
        return $this->httpPostJson('bizwifi/homepage/set', $data);
97
    }
98
}
99