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
c441abd2
Commit
c441abd2
authored
Sep 11, 2018
by
feixiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
947513bc
a63423bc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
169 additions
and
12 deletions
+169
-12
src/Common/Pool/Config/BargainPoolConfig.php
+3
-2
src/Common/Pool/Config/StateLessPoolConfig.php
+108
-0
src/Common/Pool/Config/TimeLimitBuyPoolConfig.php
+4
-4
src/Goods/Lib/GoodsInterface.php
+11
-0
src/Reservation/Enum/ReservEnum.php
+16
-0
src/Reservation/Lib/ReservationInterface.php
+4
-6
src/StateLess/Lib/StatelessInterface.php
+23
-0
No files found.
src/Common/Pool/Config/BargainPoolConfig.php
View file @
c441abd2
...
...
@@ -21,12 +21,14 @@ use Swoft\Bean\Annotation\Value;
class
BargainPoolConfig
extends
PoolProperties
{
public
function
__construct
()
{
// 区别本地和线上的RPC服务地址
$this
->
uri
=
explode
(
','
,
env
(
'RPC_BARGAIN_URI'
,
'bargain:8099'
));
}
protected
$name
=
'bargain'
;
/**
...
...
@@ -84,8 +86,7 @@ class BargainPoolConfig extends PoolProperties
* @var array
*/
protected
$uri
=
[
'172.21.0.13:8099'
,
'172.16.255.4:8099'
,
'bargain:8099'
];
/**
...
...
src/Common/Pool/Config/StateLessPoolConfig.php
0 → 100644
View file @
c441abd2
<?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
;
use
Swoft\Bean\Annotation\Value
;
/**
* @Bean()
* the config of service bargain
*/
class
StateLessPoolConfig
extends
PoolProperties
{
public
function
__construct
()
{
// 区别本地和线上的RPC服务地址
$this
->
uri
=
explode
(
','
,
env
(
'RPC_STATELESS_URI'
,
'stateless:8099'
));
}
protected
$name
=
'stateless'
;
/**
* Minimum active number of connections
*
* @var int
*/
protected
$minActive
=
5
;
/**
* the maximum number of active connections
*
* @var int
*/
protected
$maxActive
=
50
;
/**
* the maximum number of wait connections
*
* @var int
*/
protected
$maxWait
=
100
;
/**
* 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
=
5
;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
* @Value(name="", env="${RPC_BARGAIN_URI}")
* @var array
*/
protected
$uri
=
[
'172.21.0.34:8099'
,
'172.16.255.241:8099'
,
];
/**
* 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/TimeLimitBuyPoolConfig.php
View file @
c441abd2
...
...
@@ -22,10 +22,11 @@ class TimeLimitBuyPoolConfig extends PoolProperties
public
function
__construct
()
{
// 区别本地和线上的RPC服务地址
$this
->
uri
=
explode
(
','
,
env
(
'RPC_TIMELIMITBUY_URI'
,
'timelimitbuy:8099'
));
$this
->
uri
=
explode
(
','
,
env
(
'RPC_TIMELIMITBUY_URI'
,
'timelistbuy:8099'
));
}
protected
$name
=
'bargain'
;
protected
$name
=
'timelimitname'
;
/**
* Minimum active number of connections
...
...
@@ -82,8 +83,7 @@ class TimeLimitBuyPoolConfig extends PoolProperties
* @var array
*/
protected
$uri
=
[
'172.21.0.34:8099'
,
'172.16.255.241:8099'
,
'timelimtbuy:8099'
,
];
/**
...
...
src/Goods/Lib/GoodsInterface.php
View file @
c441abd2
...
...
@@ -14,6 +14,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGet($storeId, $id)
* @method ResultInterface deferIncSales($storeId, $goodsId)
* @method ResultInterface deferDecSales($storeId, $goodsId)
* @method ResultInterface deferGetServiceByGoodsId($storeId, $goodsId)
* Interface GoodsInterface
* @package Hdll\Services\Goods\Lib
*/
...
...
@@ -62,4 +63,13 @@ interface GoodsInterface
*/
public
function
decSales
(
$storeId
,
$goodsId
);
/**
* 获取商品服务
* @param $storeId
* @param $goodsId
* @return mixed
* @author Administrator
*/
public
function
getServiceByGoodsId
(
$storeId
,
$goodsId
);
}
\ No newline at end of file
src/Reservation/Enum/ReservEnum.php
0 → 100644
View file @
c441abd2
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 15:28
*/
namespace
Hdll\Services\Reservation\Enum
;
class
ReservEnum
{
const
TYPE_ORDER
=
1
;
// 表示从订单创建产生的预约
const
TYPE_SELLER
=
2
;
// 表示卖家自己后台添加的预约
const
TYPE_AFTER
=
3
;
// 表示订购服务的后续服务的预约
}
\ No newline at end of file
src/Reservation/Lib/ReservationInterface.php
View file @
c441abd2
...
...
@@ -18,7 +18,7 @@ use Swoft\Core\ResultInterface;
*
* @method ResultInterface deferGetReservById(int $storeId, int $id)
* @method ResultInterface deferIsReserved(int $storeId, int $cmanId, int $reservTime)
* @method ResultInterface deferGetReservListByOrderId(int $storeId, int $orderId, int $state = 0
, int $type = 1
)
* @method ResultInterface deferGetReservListByOrderId(int $storeId, int $orderId, int $state = 0)
* @method ResultInterface deferModifyReservById(int $storeId, int $id, array $data)
* @method ResultInterface deferAddReservation(int $storeId, int $orderId, int $buyerId, int $cmanId, int $reservTime, string $memo, int $type)
* @method ResultInterface deferCancelReservById(int $storeId, int $id)
...
...
@@ -53,10 +53,9 @@ interface ReservationInterface
* @param integer $storeId
* @param integer $orderId
* @param integer $state
* @param integer $type
* @return array
*/
public
function
getReservListByOrderId
(
int
$storeId
,
int
$orderId
,
int
$state
=
0
,
int
$type
=
1
);
public
function
getReservListByOrderId
(
int
$storeId
,
int
$orderId
,
int
$state
=
0
);
/**
* 修改某个预约信息
...
...
@@ -66,7 +65,6 @@ interface ReservationInterface
* @param array $data
* $data 字段说明:
* ['state'] => 预约状态,默认0,如果正常结束则为1
* ['type'] => 预约类型,备用
* ['reservTime'] => 预约时间,整形,时间戳格式
* ['memo'] => 预约备注
* @return int 返回成功修改的条数
...
...
@@ -82,10 +80,10 @@ interface ReservationInterface
* @param integer $cmanId 手艺人id
* @param integer $reservTime 预约的时间
* @param string $memo 预约备注
* @param integer $type 预约类型,
备用
* @param integer $type 预约类型,
传值类型参加 ../Enum/ReservEnum.php
* @return integer 添加成功则返回记录id
*/
public
function
addReservation
(
int
$storeId
,
int
$orderId
,
int
$buyerId
,
int
$cmanId
,
int
$reservTime
,
string
$memo
,
int
$type
=
1
);
public
function
addReservation
(
int
$storeId
,
int
$orderId
,
int
$buyerId
,
int
$cmanId
,
int
$reservTime
,
string
$memo
,
int
$type
);
/**
* 取消某个预约
...
...
src/StateLess/Lib/StatelessInterface.php
0 → 100644
View file @
c441abd2
<?php
namespace
Hdll\Services\StateLess\Lib
;
use
Swoft\Core\ResultInterface
;
/**
* The interface of demo service
*
* @method ResultInterface deferChecktoken(string $formtoken,int $store_id)
*/
interface
StatelessInterface
{
/**
* 判断formtoken 是否有效
* @param $formtoken
* @param $store_id
* @return bool // true or false
*/
public
function
checktoken
(
string
$formtoken
,
int
$store_id
);
}
\ 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