Completed
Push — master ( 527ee4...decbe2 )
by Carlos
05:01 queued 02:36
created

Client::withdrawAudit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\OpenPlatform\Authorizer\MiniProgram\Code;
13
14
use EasyWeChat\Kernel\BaseClient;
15
16
/**
17
 * Class Client.
18
 *
19
 * @author mingyoung <[email protected]>
20
 */
21
class Client extends BaseClient
22
{
23
    /**
24
     * @param int    $templateId
25
     * @param string $extJson
26
     * @param string $version
27
     * @param string $description
28
     *
29
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
30
     */
31
    public function commit(int $templateId, string $extJson, string $version, string $description)
32
    {
33
        return $this->httpPostJson('wxa/commit', [
34
            'template_id' => $templateId,
35
            'ext_json' => $extJson,
36
            'user_version' => $version,
37
            'user_desc' => $description,
38
        ]);
39
    }
40
41
    /**
42
     * @return \EasyWeChat\Kernel\Http\Response
43
     */
44
    public function getQrCode()
45
    {
46
        return $this->requestRaw('wxa/get_qrcode', 'GET');
47
    }
48
49
    /**
50
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
51
     */
52
    public function getCategory()
53
    {
54
        return $this->httpGet('wxa/get_category');
55
    }
56
57
    /**
58
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
59
     */
60
    public function getPage()
61
    {
62
        return $this->httpGet('wxa/get_page');
63
    }
64
65
    /**
66
     * @param array $itemList
67
     *
68
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
69
     */
70
    public function submitAudit(array $itemList)
71
    {
72
        return $this->httpPostJson('wxa/submit_audit', [
73
            'item_list' => $itemList,
74
        ]);
75
    }
76
77
    /**
78
     * @param int $auditId
79
     *
80
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
81
     */
82
    public function getAuditStatus(int $auditId)
83
    {
84
        return $this->httpPostJson('wxa/get_auditstatus', [
85
            'auditid' => $auditId,
86
        ]);
87
    }
88
89
    /**
90
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
91
     */
92
    public function getLatestAuditStatus()
93
    {
94
        return $this->httpGet('wxa/get_latest_auditstatus');
95
    }
96
97
    /**
98
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
99
     */
100
    public function release()
101
    {
102
        return $this->httpPostJson('wxa/release');
103
    }
104
105
    /**
106
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
107
     */
108
    public function withdrawAudit()
109
    {
110
        return $this->httpGet('wxa/undocodeaudit');
111
    }
112
113
    /**
114
     * @param string $action
115
     *
116
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
117
     */
118
    public function changeVisitStatus(string $action)
119
    {
120
        return $this->httpPostJson('wxa/change_visitstatus', [
121
            'action' => $action,
122
        ]);
123
    }
124
}
125