Commit 8f1b8f5e by xmy

feat:实物 物流 评论 上线

parent 87ff5f33
...@@ -129,4 +129,12 @@ interface BuyerInterface ...@@ -129,4 +129,12 @@ interface BuyerInterface
* @return mixed * @return mixed
*/ */
public function updateUser($storeId, $buyerId, $data); public function updateUser($storeId, $buyerId, $data);
/**
* 获取买家信息
* @param $storeId
* @param $openId
* @return mixed
*/
public function getUserByOpenId($storeId, $openId);
} }
\ No newline at end of file
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
/**
* @Bean()
*/
class CommentsPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_COMMENTS_URI', 'comments:8099'));
}
protected $name = 'coupon';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 300;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 400;
/**
* Maximum waiting time
*
* @var int
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
* @var int
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
* @var int
*/
protected $timeout = 200;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
* @var array
*/
protected $uri = [];
/**
* whether to user provider(consul/etcd/zookeeper)
*
* @var bool
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
* @var string
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
* @var string
*/
protected $provider = '';
}
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Bean\Annotation\Value;
use Swoft\Pool\PoolProperties;
/**
* the config of service user
*
* @Bean()
*/
class LogisticsPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_LOGISTICS_URI', 'logistics:8099'));
}
/**
* the name of pool
*
*/
protected $name = 'logistics';
/**
* Minimum active number of connections
*
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
*/
protected $maxActive = 300;
/**
* the maximum number of wait connections
*
*/
protected $maxWait = 400;
/**
* Maximum waiting time
*
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
*/
protected $timeout = 200;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
*/
protected $uri = [
"buyer:8099",
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
*/
protected $provider = '';
}
...@@ -5,10 +5,20 @@ ...@@ -5,10 +5,20 @@
* Date: 2018/7/26 * Date: 2018/7/26
* Time: 16:00 * Time: 16:00
*/ */
namespace Hdll\Services\Goods\Enum; namespace Hdll\Services\Goods\Enum;
class GoodsEnum{ class GoodsEnum
{
const ON_OFFER = 0;//出售中 const ON_OFFER = 0;//出售中
const SOLD_OUT = 1;//下架 const SOLD_OUT = 1;//下架
const SELL_OUT = 2;//售完 const SELL_OUT = 2;//售完
const SERVER_GOODS = 1;//服务商品
const ENTITY_GOODS = 2;//实体商品
const FREIGHT_FREE = 1; //包邮
const FREIGHT_DISTANCE = 2;//距离邮费
const FREIGHT_WEIGHT = 3;//重量邮费
} }
\ No newline at end of file
...@@ -28,6 +28,8 @@ use Swoft\Core\ResultInterface; ...@@ -28,6 +28,8 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetReturnVisitByGoodsIds($storeId, $goodsIds) * @method ResultInterface deferGetReturnVisitByGoodsIds($storeId, $goodsIds)
* @method ResultInterface deferCountEvaluate($storeId, $time) * @method ResultInterface deferCountEvaluate($storeId, $time)
* @method ResultInterface deferFind($storeId, $id) * @method ResultInterface deferFind($storeId, $id)
* @method ResultInterface deferReduceStock($storeId, $goods)
* @method ResultInterface deferAddStock($storeId, $goods)
* Interface GoodsInterface * Interface GoodsInterface
* @package Hdll\Services\Goods\Lib * @package Hdll\Services\Goods\Lib
*/ */
...@@ -186,4 +188,25 @@ interface GoodsInterface ...@@ -186,4 +188,25 @@ interface GoodsInterface
* @return array|mixed * @return array|mixed
*/ */
public function find($storeId, $id); public function find($storeId, $id);
/**
* 减少库存
* @param $storeId
* @param $goods = [
* 商品 goodsId=>num,
* sku goodsId=>[skuId=>num]
* ]
*/
public function reduceStock($storeId, $goods);
/**
* 增加库存
* @param $storeId
* @param $goods =[
* 商品 goodsId=>num,
* sku goodsId=>[skuId=>num]
* ]
*/
public function addStock($storeId, $goods);
} }
<?php
namespace Hdll\Services\Logistics\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferOnPath(array $param)
* @method ResultInterface deferHandleFreight($storeId, array $receiver, array $goods)
* Class LotteryInterface
* @package Hdll\Services\Logistics\Lib
*/
interface LogisticsInterface
{
public function onPath(array $param);
/**
* 获取运费
* @param $storeId
* @param array $receiver
* @param array $goods
* @return mixed
*/
public function handleFreight($storeId, array $receiver, array $goods);
/**
* 获取收货人地址
* @param $id
* @param $storeId
* @return mixed
*/
public function getReceiver($id, $storeId);
}
\ No newline at end of file
<?php
namespace Hdll\Services\StateLess\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferSave($nickname, $headimgurl)
* Interface VirtualUserService
* @package Hdll\Services\StateLess\Lib
*/
interface VirtualUserService
{
public function save($nickname, $headimgurl);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment