From f04f6ce44bebbc8ef91eb87b17ed95a3aed9c955 Mon Sep 17 00:00:00 2001 From: wuliangbo Date: Sat, 11 Apr 2020 18:38:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=9A=E6=AC=A1=E9=80=80?= =?UTF-8?q?=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mini/Model/VersionAuditContentBuilder.php | 30 +++++-------------- .../Authorizer/Mini/Version/Client.php | 14 ++++----- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/src/OpenPlatform/Authorizer/Mini/Model/VersionAuditContentBuilder.php b/src/OpenPlatform/Authorizer/Mini/Model/VersionAuditContentBuilder.php index 7868ac3..765683f 100644 --- a/src/OpenPlatform/Authorizer/Mini/Model/VersionAuditContentBuilder.php +++ b/src/OpenPlatform/Authorizer/Mini/Model/VersionAuditContentBuilder.php @@ -7,7 +7,9 @@ */ namespace EasyAlipay\OpenPlatform\Authorizer\Mini\Model; -class VersionAuditContentBuilder +use EasyAlipay\Kernel\AppRequest; + +class VersionAuditContentBuilder extends AppRequest { /** * @var string 小程序版本号 @@ -25,22 +27,6 @@ class VersionAuditContentBuilder * @var array 省市区信息,当区域类型为LOCATION时,不能为空 */ private $serviceRegionInfo; - /** - * @var array 参数数组 - */ - private $bizContentarr = []; - /** - * @var string 参数字符串 - */ - private $bizContent = NULL; - - public function getBizContent() - { - if (!empty($this->bizContentarr)) { - $this->bizContent = json_encode($this->bizContentarr, JSON_UNESCAPED_UNICODE); - } - return $this->bizContent; - } /** * @param $appVersion @@ -48,7 +34,7 @@ class VersionAuditContentBuilder public function setAppVersion($appVersion) { $this->appVersion = $appVersion; - $this->bizContentarr['app_version'] = $appVersion; + $this->apiParas['app_version'] = $appVersion; } /** @@ -65,7 +51,7 @@ class VersionAuditContentBuilder public function setVersionDesc($versionDesc) { $this->versionDesc = $versionDesc; - $this->bizContentarr['version_desc'] = $versionDesc; + $this->apiParas['version_desc'] = $versionDesc; } /** @@ -82,7 +68,7 @@ class VersionAuditContentBuilder public function setRegionType($regionType) { $this->regionType = $regionType; - $this->bizContentarr['region_type'] = $regionType; + $this->apiParas['region_type'] = $regionType; } /** @@ -99,7 +85,7 @@ class VersionAuditContentBuilder public function setServiceRegionInfo($serviceRegionInfo) { $this->serviceRegionInfo = $serviceRegionInfo; - $this->bizContentarr['service_region_info'] = $serviceRegionInfo; + $this->apiParas['service_region_info'] = $serviceRegionInfo; } /** @@ -117,7 +103,7 @@ class VersionAuditContentBuilder public function setParams($params) { foreach ($params as $k => $v) { - $this->bizContentarr[$k] = $v; + $this->apiParas[$k] = $v; } } } \ No newline at end of file diff --git a/src/OpenPlatform/Authorizer/Mini/Version/Client.php b/src/OpenPlatform/Authorizer/Mini/Version/Client.php index 275b770..d9bfc33 100644 --- a/src/OpenPlatform/Authorizer/Mini/Version/Client.php +++ b/src/OpenPlatform/Authorizer/Mini/Version/Client.php @@ -63,16 +63,14 @@ class Client extends AppClient */ public function audit(string $appVersion, string $versionDesc, string $regionType, array $serviceRegionInfo = [], array $params = []) { - $contentBuilder = new VersionAuditContentBuilder(); - $contentBuilder->setAppVersion($appVersion); - $contentBuilder->setVersionDesc($versionDesc); - $contentBuilder->setRegionType($regionType); + $request = new VersionAuditContentBuilder(); + $request->setAppVersion($appVersion); + $request->setVersionDesc($versionDesc); + $request->setRegionType($regionType); if ($regionType == 'LOCATION') { - $contentBuilder->setServiceRegionInfo($serviceRegionInfo); + $request->setServiceRegionInfo($serviceRegionInfo); } - $contentBuilder->setParams($params); - $request = new AppRequest(); - $request->setBizContent($contentBuilder->getBizContent()); + $request->setParams($params); $request->setApiMethodName("alipay.open.mini.version.audit.apply"); return ($this->execute($request)); }