Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
8f1b8f5e
Commit
8f1b8f5e
authored
Dec 04, 2019
by
xmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:实物 物流 评论 上线
parent
87ff5f33
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
305 additions
and
1 deletions
+305
-1
src/Buyer/Lib/BuyerInterface.php
+9
-0
src/Common/Pool/Config/CommentsPoolConfig.php
+104
-0
src/Common/Pool/Config/LogisticsPoolConfig.php
+105
-0
src/Goods/Enum/GoodsEnum.php
+12
-1
src/Goods/Lib/GoodsInterface.php
+23
-0
src/Logistics/Lib/LogisticsInterface.php
+35
-0
src/StateLess/Lib/VirtualUserService.php
+17
-0
No files found.
src/Buyer/Lib/BuyerInterface.php
View file @
8f1b8f5e
...
@@ -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
src/Common/Pool/Config/CommentsPoolConfig.php
0 → 100644
View file @
8f1b8f5e
<?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
=
''
;
}
src/Common/Pool/Config/LogisticsPoolConfig.php
0 → 100644
View file @
8f1b8f5e
<?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
=
''
;
}
src/Goods/Enum/GoodsEnum.php
View file @
8f1b8f5e
...
@@ -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
src/Goods/Lib/GoodsInterface.php
View file @
8f1b8f5e
...
@@ -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
);
}
}
src/Logistics/Lib/LogisticsInterface.php
0 → 100644
View file @
8f1b8f5e
<?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
src/StateLess/Lib/VirtualUserService.php
0 → 100644
View file @
8f1b8f5e
<?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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment