Skip to content

Commit

Permalink
3.9 查询赠品信息接口
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorCho committed Sep 14, 2018
1 parent a687fb9 commit 132f662
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 5 deletions.
19 changes: 19 additions & 0 deletions src/Product/GetSkuGiftClient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* @link https://www.init.lu
* @author Cao Kang(caokang@outlook.com)
* Date: 2018/9/14
* Time: 上午10:49
* Source: GetSkuGiftClient.php
* Project: libjdvop
*/

namespace Zeevin\Libjdvop\Product;


class GetSkuGiftClient
{
protected $domain = 'product';
protected $prefix = 'getSkuGift';
protected $method = 'POST';
}
148 changes: 148 additions & 0 deletions src/Product/RequestAttribute/GetSkuGift/Request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?php
/**
* @link https://www.init.lu
* @author Cao Kang(caokang@outlook.com)
* Date: 2018/9/14
* Time: 上午10:47
* Source: Request.php
* Project: libjdvop
*/

namespace Zeevin\Libjdvop\Product\RequestAttribute\GetSkuGift;


use JMS\Serializer\Annotation as JMS;
use JMS\Serializer\Annotation\SerializedName;
use Zeevin\Libjdvop\Core\BaseRequestAttribute;

class Request extends BaseRequestAttribute
{
/**
* 商品编号
* @JMS\XmlElement(cdata=false)
* @SerializedName("skuId")
* @JMS\Type("string")
*/
protected $skuId;
/**
* @JMS\XmlElement(cdata=false)
* @SerializedName("province")
* @JMS\Type("integer")
*/
protected $province;
/**
* @JMS\XmlElement(cdata=false)
* @SerializedName("city")
* @JMS\Type("integer")
*/
protected $city;
/**
* @JMS\XmlElement(cdata=false)
* @SerializedName("county")
* @JMS\Type("integer")
*/
protected $county;
/**
* @JMS\XmlElement(cdata=false)
* @SerializedName("town")
* @JMS\Type("integer")
*/
protected $town;

/**
* @return mixed
*/
public function getSkuIds()
{
return $this->skuIds;
}

/**
* @param $skuId
*
* @return $this
*/
public function setSkuId($skuId)
{
$this->skuId = $skuId;
return $this;
}

/**
* @return mixed
*/
public function getProvince()
{
return $this->province;
}

/**
* @param $province
*
* @return $this
*/
public function setProvince($province)
{
$this->province = $province;
return $this;
}

/**
* @return mixed
*/
public function getCity()
{
return $this->city;
}

/**
* @param $city
*
* @return $this
*/
public function setCity($city)
{
$this->city = $city;
return $this;
}

/**
* @return mixed
*/
public function getCounty()
{
return $this->county;
}

/**
* @param $county
*
* @return $this
*/
public function setCounty($county)
{
$this->county = $county;
return $this;
}

/**
* @return mixed
*/
public function getTown()
{
return $this->town;
}

/**
* @param $town
*
* @return $this
*/
public function setTown($town)
{
$this->town = $town;
return $this;
}


}
4 changes: 4 additions & 0 deletions src/Product/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,9 @@ public function register(Container $app)
{
return new GetCategorysClient($app);
};
$app['Product.GetSkuGift'] = function ($app)
{
return new GetSkuGiftClient($app);
};
}
}
2 changes: 1 addition & 1 deletion tests/Area_GetCity.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$application = new \Zeevin\Libjdvop\Application($config);

$request = new \Zeevin\Libjdvop\Area\RequestAttribute\GetCity\Request();
$request->setId(13);
$request->setId(52993);
$reqData = $request->serialize();

/** @var \Zeevin\Libjdvop\Area\GetCityClient $app */
Expand Down
4 changes: 2 additions & 2 deletions tests/Product_GetDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
$request = new \Zeevin\Libjdvop\Product\RequestAttribute\GetDetail\Request();


$request->setSku(3008171)->setQueryExts(['appintroduce','shouhou']);
$request->setSku(6280060)->setQueryExts(['appintroduce','shouhou']);
$reqData = $request->serialize();
//print_r($reqData);exit;
/** @var \Zeevin\Libjdvop\Product\GetDetailClient $app */
$app = $application['Product.GetDetail'];
/** @var \Zeevin\Libjdvop\Product\ResponseAttribute\GetDetail\Response $ret */
$ret = $app->request($reqData)->getResponse();
//var_dump($ret);exit;
var_dump($ret);exit;
echo($ret->getResult()->getIntroduction());
4 changes: 2 additions & 2 deletions tests/Product_SkuState.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
$request = new \Zeevin\Libjdvop\Product\RequestAttribute\SkuState\Request();


$request->setSku(165145);
$request->setSku([165145]);
$reqData = $request->serialize();
//print_r($reqData);exit;
/** @var \Zeevin\Libjdvop\Product\SkuStateClient $app */
$app = $application['Product.SkuState'];
/** @var \Zeevin\Libjdvop\Product\ResponseAttribute\SkuState\Response $ret */
$ret = $app->request($reqData)->getResponse();
//var_dump($ret);exit;
print_r($ret);
print_r($ret->getResult());

0 comments on commit 132f662

Please sign in to comment.