| Total Complexity | 3 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class Client extends BaseClient |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * 获取公众号关联的小程序. |
||
| 25 | * |
||
| 26 | * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
||
| 27 | * |
||
| 28 | * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
||
| 29 | */ |
||
| 30 | public function list() |
||
| 31 | { |
||
| 32 | return $this->httpPostJson('cgi-bin/wxopen/wxamplinkget'); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * 关联小程序. |
||
| 37 | * |
||
| 38 | * @param string $appId |
||
| 39 | * @param bool $notifyUsers |
||
| 40 | * @param bool $showProfile |
||
| 41 | * |
||
| 42 | * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
||
| 43 | * |
||
| 44 | * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
||
| 45 | */ |
||
| 46 | public function link(string $appId, bool $notifyUsers = true, bool $showProfile = false) |
||
| 47 | { |
||
| 48 | $params = [ |
||
| 49 | 'appid' => $appId, |
||
| 50 | 'notify_users' => (string) $notifyUsers, |
||
| 51 | 'show_profile' => (string) $showProfile, |
||
| 52 | ]; |
||
| 53 | |||
| 54 | return $this->httpPostJson('cgi-bin/wxopen/wxamplink', $params); |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * 解除已关联的小程序. |
||
| 59 | * |
||
| 60 | * @param string $appId |
||
| 61 | * |
||
| 62 | * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
||
| 63 | * |
||
| 64 | * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
||
| 65 | */ |
||
| 66 | public function unlink(string $appId) |
||
| 73 | } |
||
| 74 | } |
||
| 75 |