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
eb7aa258
Commit
eb7aa258
authored
Sep 12, 2018
by
王召彬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.2b3.cn/tencent/services
parents
91e82ece
20d82bc9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
196 additions
and
17 deletions
+196
-17
src/Common/Pool/Config/BargainPoolConfig.php
+3
-2
src/Common/Pool/Config/OrderPoolConfig.php
+1
-1
src/Common/Pool/Config/StateLessPoolConfig.php
+108
-0
src/Common/Pool/Config/TimeLimitBuyPoolConfig.php
+4
-4
src/Goods/Lib/GoodsInterface.php
+11
-0
src/Notice/Enum/NoticeEnum.php
+7
-4
src/Notice/Lib/NoticeInterface.php
+19
-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 @
eb7aa258
...
@@ -21,12 +21,14 @@ use Swoft\Bean\Annotation\Value;
...
@@ -21,12 +21,14 @@ use Swoft\Bean\Annotation\Value;
class
BargainPoolConfig
extends
PoolProperties
class
BargainPoolConfig
extends
PoolProperties
{
{
public
function
__construct
()
public
function
__construct
()
{
{
// 区别本地和线上的RPC服务地址
// 区别本地和线上的RPC服务地址
$this
->
uri
=
explode
(
','
,
env
(
'RPC_BARGAIN_URI'
,
'bargain:8099'
));
$this
->
uri
=
explode
(
','
,
env
(
'RPC_BARGAIN_URI'
,
'bargain:8099'
));
}
}
protected
$name
=
'bargain'
;
protected
$name
=
'bargain'
;
/**
/**
...
@@ -84,8 +86,7 @@ class BargainPoolConfig extends PoolProperties
...
@@ -84,8 +86,7 @@ class BargainPoolConfig extends PoolProperties
* @var array
* @var array
*/
*/
protected
$uri
=
[
protected
$uri
=
[
'172.21.0.13:8099'
,
'bargain:8099'
'172.16.255.4:8099'
,
];
];
/**
/**
...
...
src/Common/Pool/Config/OrderPoolConfig.php
View file @
eb7aa258
...
@@ -68,7 +68,7 @@ class OrderPoolConfig extends PoolProperties
...
@@ -68,7 +68,7 @@ class OrderPoolConfig extends PoolProperties
*
*
* @var int
* @var int
*/
*/
protected
$timeout
=
15
;
protected
$timeout
=
200
;
/**
/**
* the addresses of connection
* the addresses of connection
...
...
src/Common/Pool/Config/StateLessPoolConfig.php
0 → 100644
View file @
eb7aa258
<?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 @
eb7aa258
...
@@ -22,10 +22,11 @@ class TimeLimitBuyPoolConfig extends PoolProperties
...
@@ -22,10 +22,11 @@ class TimeLimitBuyPoolConfig extends PoolProperties
public
function
__construct
()
public
function
__construct
()
{
{
// 区别本地和线上的RPC服务地址
// 区别本地和线上的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
* Minimum active number of connections
...
@@ -82,8 +83,7 @@ class TimeLimitBuyPoolConfig extends PoolProperties
...
@@ -82,8 +83,7 @@ class TimeLimitBuyPoolConfig extends PoolProperties
* @var array
* @var array
*/
*/
protected
$uri
=
[
protected
$uri
=
[
'172.21.0.34:8099'
,
'timelimtbuy:8099'
,
'172.16.255.241:8099'
,
];
];
/**
/**
...
...
src/Goods/Lib/GoodsInterface.php
View file @
eb7aa258
...
@@ -14,6 +14,7 @@ use Swoft\Core\ResultInterface;
...
@@ -14,6 +14,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGet($storeId, $id)
* @method ResultInterface deferGet($storeId, $id)
* @method ResultInterface deferIncSales($storeId, $goodsId)
* @method ResultInterface deferIncSales($storeId, $goodsId)
* @method ResultInterface deferDecSales($storeId, $goodsId)
* @method ResultInterface deferDecSales($storeId, $goodsId)
* @method ResultInterface deferGetServiceByGoodsId($storeId, $goodsId)
* Interface GoodsInterface
* Interface GoodsInterface
* @package Hdll\Services\Goods\Lib
* @package Hdll\Services\Goods\Lib
*/
*/
...
@@ -62,4 +63,13 @@ interface GoodsInterface
...
@@ -62,4 +63,13 @@ interface GoodsInterface
*/
*/
public
function
decSales
(
$storeId
,
$goodsId
);
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/Notice/Enum/NoticeEnum.php
View file @
eb7aa258
...
@@ -11,19 +11,22 @@ namespace Hdll\Services\Notice\Enum;
...
@@ -11,19 +11,22 @@ namespace Hdll\Services\Notice\Enum;
class
NoticeEnum
class
NoticeEnum
{
{
//商家小程序发送
//商家小程序发送
const
TYPE_MINI_BACKEND_SEND
=
1
;
const
TYPE_MINI_BACKEND_SEND
=
1
00
;
//腾讯sms发送
//腾讯sms发送
const
TYPE_TENCENT_SMS
=
2
;
const
TYPE_TENCENT_SMS
=
150
;
//买家小程序消息推送
//买家小程序消息推送
const
TYPE_MINI_FRONTEND_SEND
=
3
;
const
TYPE_MINI_FRONTEND_SEND
=
101
;
const
TYPE_MP_SEND
=
102
;
const
SEND_TYPES
=
[
const
SEND_TYPES
=
[
self
::
TYPE_MINI_BACKEND_SEND
,
self
::
TYPE_MINI_BACKEND_SEND
,
self
::
TYPE_TENCENT_SMS
,
self
::
TYPE_TENCENT_SMS
,
self
::
TYPE_MINI_FRONTEND_SEND
self
::
TYPE_MINI_FRONTEND_SEND
,
self
::
TYPE_MP_SEND
,
];
];
...
...
src/Notice/Lib/NoticeInterface.php
View file @
eb7aa258
...
@@ -58,6 +58,25 @@ interface NoticeInterface
...
@@ -58,6 +58,25 @@ interface NoticeInterface
]
]
];
];
*
*
* 微信公众号发送实例
$data[NoticeEnum::TYPE_MP_SEND] = [
'touser' => 'o3lFcs8xoWfQUlhzTiP5uZI6A7Hc', //这里要填写公众号的openId
'template_id' => 'zwUBuoKVRJkumLwGkippA46XfmLsmwJD906HC-wqOks',
'miniprogram' => [
'appid' => 'wx3b3b2df942634cdd', //小程序appid
'pagepath' => 'pages/start/start'//小程序页面
],
'data' => [
'first' => 'first',
'keyword1' => '姓名',
'keyword2' => '1213456',
'keyword3' => '测试门店',
'keyword4' => '门店地址',
'keyword5' => 'test',
'remark' => 'remark'
]
];
*
* @param array $sendTypes
* @param array $sendTypes
* @param array $data
* @param array $data
* @param int $sendTime //发送时间,立即返送填0
* @param int $sendTime //发送时间,立即返送填0
...
...
src/Reservation/Enum/ReservEnum.php
0 → 100644
View file @
eb7aa258
<?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 @
eb7aa258
...
@@ -18,7 +18,7 @@ use Swoft\Core\ResultInterface;
...
@@ -18,7 +18,7 @@ use Swoft\Core\ResultInterface;
*
*
* @method ResultInterface deferGetReservById(int $storeId, int $id)
* @method ResultInterface deferGetReservById(int $storeId, int $id)
* @method ResultInterface deferIsReserved(int $storeId, int $cmanId, int $reservTime)
* @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 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 deferAddReservation(int $storeId, int $orderId, int $buyerId, int $cmanId, int $reservTime, string $memo, int $type)
* @method ResultInterface deferCancelReservById(int $storeId, int $id)
* @method ResultInterface deferCancelReservById(int $storeId, int $id)
...
@@ -53,10 +53,9 @@ interface ReservationInterface
...
@@ -53,10 +53,9 @@ interface ReservationInterface
* @param integer $storeId
* @param integer $storeId
* @param integer $orderId
* @param integer $orderId
* @param integer $state
* @param integer $state
* @param integer $type
* @return array
* @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
...
@@ -66,7 +65,6 @@ interface ReservationInterface
* @param array $data
* @param array $data
* $data 字段说明:
* $data 字段说明:
* ['state'] => 预约状态,默认0,如果正常结束则为1
* ['state'] => 预约状态,默认0,如果正常结束则为1
* ['type'] => 预约类型,备用
* ['reservTime'] => 预约时间,整形,时间戳格式
* ['reservTime'] => 预约时间,整形,时间戳格式
* ['memo'] => 预约备注
* ['memo'] => 预约备注
* @return int 返回成功修改的条数
* @return int 返回成功修改的条数
...
@@ -82,10 +80,10 @@ interface ReservationInterface
...
@@ -82,10 +80,10 @@ interface ReservationInterface
* @param integer $cmanId 手艺人id
* @param integer $cmanId 手艺人id
* @param integer $reservTime 预约的时间
* @param integer $reservTime 预约的时间
* @param string $memo 预约备注
* @param string $memo 预约备注
* @param integer $type 预约类型,
备用
* @param integer $type 预约类型,
传值类型参加 ../Enum/ReservEnum.php
* @return integer 添加成功则返回记录id
* @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 @
eb7aa258
<?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