| Total Complexity | 4 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class Client extends BaseClient |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * 获取草稿箱内的所有临时代码草稿 |
||
| 25 | * |
||
| 26 | * @return mixed |
||
| 27 | * |
||
| 28 | * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
||
| 29 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 30 | */ |
||
| 31 | 1 | public function getDrafts() |
|
| 32 | { |
||
| 33 | 1 | return $this->httpGet('wxa/gettemplatedraftlist'); |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * 将草稿箱的草稿选为小程序代码模版. |
||
| 38 | * |
||
| 39 | * @param int $draftId |
||
| 40 | * |
||
| 41 | * @return mixed |
||
| 42 | * |
||
| 43 | * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
||
| 44 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 45 | */ |
||
| 46 | 1 | public function createFromDraft(int $draftId) |
|
| 47 | { |
||
| 48 | $params = [ |
||
| 49 | 1 | 'draft_id' => $draftId, |
|
| 50 | ]; |
||
| 51 | |||
| 52 | 1 | return $this->httpPostJson('wxa/addtotemplate', $params); |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * 获取代码模版库中的所有小程序代码模版. |
||
| 57 | * |
||
| 58 | * @return mixed |
||
| 59 | * |
||
| 60 | * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
||
| 61 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 62 | */ |
||
| 63 | 1 | public function list() |
|
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * 删除指定小程序代码模版. |
||
| 70 | * |
||
| 71 | * @param string $templateId |
||
| 72 | * |
||
| 73 | * @return mixed |
||
| 74 | * |
||
| 75 | * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
||
| 76 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 77 | */ |
||
| 78 | 1 | public function delete($templateId) |
|
| 85 | } |
||
| 86 | } |
||
| 87 |