Skip to content

Commit

Permalink
Merge pull request #924 from HanSon/patch-5
Browse files Browse the repository at this point in the history
make domain more flexible
  • Loading branch information
mingyoung authored Sep 12, 2017
2 parents 3e806de + eb8a6c5 commit bb7f989
Showing 1 changed file with 2 additions and 61 deletions.
63 changes: 2 additions & 61 deletions src/OpenPlatform/Authorizer/MiniProgram/Domain/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,71 +21,12 @@
class Client extends BaseClient
{
/**
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*/
public function get()
{
return $this->modify('get');
}

/**
* @param array $request
* @param array $wsRequest
* @param array $upload
* @param array $download
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*/
public function set(array $request, array $wsRequest, array $upload, array $download)
{
return $this->modify('set', $request, $wsRequest, $upload, $download);
}

/**
* @param array $request
* @param array $wsRequest
* @param array $upload
* @param array $download
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*/
public function add(array $request, array $wsRequest, array $upload, array $download)
{
return $this->modify('add', $request, $wsRequest, $upload, $download);
}

/**
* @param array $request
* @param array $wsRequest
* @param array $upload
* @param array $download
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*/
public function delete(array $request, array $wsRequest, array $upload, array $download)
{
return $this->modify('delete', $request, $wsRequest, $upload, $download);
}

/**
* @param string $action
* @param array $request
* @param array $wsRequest
* @param array $upload
* @param array $download
* @param array $params
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*/
protected function modify(string $action, array $request = [], array $wsRequest = [], array $upload = [], array $download = [])
public function modify(array $params)
{
$params = array_filter([
'action' => $action,
'requestdomain' => $request,
'wsrequestdomain' => $wsRequest,
'uploaddomain' => $upload,
'downloaddomain' => $download,
]);

return $this->httpPostJson('wxa/modify_domain', $params);
}
}

0 comments on commit bb7f989

Please sign in to comment.