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
c2004a11
Commit
c2004a11
authored
Jul 31, 2018
by
zhufx
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
528c45d3
5a473685
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
355 additions
and
11 deletions
+355
-11
src/BuyerDistribution/Enum/BuyerDistributionError.php
+1
-1
src/Common/Lib/Smscode.php
+2
-1
src/Common/Pool/Config/SellerDistributionPoolConfig.php
+104
-0
src/Common/Pool/Config/SellerPoolConfig.php
+1
-1
src/FlowMetering/Lib/FlowMeteringInterface.php
+37
-0
src/Seller/Enum/SellerError.php
+3
-3
src/Seller/Lib/SellerInterface.php
+22
-4
src/SellerDistribution/Enum/SellerDistributionError.php
+37
-0
src/SellerDistribution/Lib/SellerDistributionInterface.php
+42
-0
src/Store/Lib/StoreInterface.php
+1
-1
src/Store/Lib/TemplateInterface.php
+85
-0
src/Vip/Enum/VipEnum.php
+20
-0
No files found.
src/BuyerDistribution/Enum/BuyerDistributionE
num
.php
→
src/BuyerDistribution/Enum/BuyerDistributionE
rror
.php
View file @
c2004a11
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
namespace
Hdll\Services\Order\Enum
;
namespace
Hdll\Services\Order\Enum
;
class
BuyerDistributionE
num
class
BuyerDistributionE
rror
{
{
const
E101
=
[
'101'
,
'金额不能小于0'
];
const
E101
=
[
'101'
,
'金额不能小于0'
];
...
...
src/Common/Lib/Smscode.php
View file @
c2004a11
...
@@ -93,7 +93,7 @@ class Smscode
...
@@ -93,7 +93,7 @@ class Smscode
private
function
getKey
(
$mobile
)
private
function
getKey
(
$mobile
)
{
{
return
'smscode
-
'
.
md5
(
$this
->
sellerId
.
'|'
.
$mobile
);
return
'smscode
:
'
.
md5
(
$this
->
sellerId
.
'|'
.
$mobile
);
}
}
}
}
\ No newline at end of file
src/Common/Pool/Config/SellerDistributionPoolConfig.php
0 → 100644
View file @
c2004a11
<?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
;
/**
* the config of service user
*
* @Bean()
*/
class
SellerDistributionPoolConfig
extends
PoolProperties
{
protected
$name
=
'sellerDistribution'
;
/**
* 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
=
200
;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
* @var array
*/
protected
$uri
=
[
'192.168.3.39:8100'
,
];
/**
* 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/SellerPoolConfig.php
View file @
c2004a11
...
@@ -78,7 +78,7 @@ class SellerPoolConfig extends PoolProperties
...
@@ -78,7 +78,7 @@ class SellerPoolConfig extends PoolProperties
* @var array
* @var array
*/
*/
protected
$uri
=
[
protected
$uri
=
[
'192.168.3.
100:8101
'
,
'192.168.3.
39:8099
'
,
];
];
/**
/**
...
...
src/FlowMetering/Lib/FlowMeteringInterface.php
0 → 100644
View file @
c2004a11
<?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\FlowMetering\Lib
;
use
Swoft\Core\ResultInterface
;
/**
* The interface of demo service
*
* @method ResultInterface deferOrderMark(string $token, int $orderType, int $orderId, float $money)
*/
interface
FlowMeteringInterface
{
/**
* @param string $token
* @param int $orderType
* @param int $orderId
* @param float $money
* @return mixed
*/
public
function
OrderMark
(
string
$token
,
int
$orderType
,
int
$orderId
,
float
$money
);
}
\ No newline at end of file
src/Seller/Enum/Seller
DistributionEnum
.php
→
src/Seller/Enum/Seller
Error
.php
View file @
c2004a11
...
@@ -6,12 +6,12 @@
...
@@ -6,12 +6,12 @@
* Time: 14:19
* Time: 14:19
*/
*/
namespace
Hdll\Services\
Ord
er\Enum
;
namespace
Hdll\Services\
Sell
er\Enum
;
class
Seller
DistributionEnum
class
Seller
Error
{
{
const
E101
=
[
'101'
,
'金额不能小于0'
];
const
E101
=
[
101
,
'金额不能小于0'
];
const
E102
=
[
102
,
'该数据不属于您'
,
403
];
const
E102
=
[
102
,
'该数据不属于您'
,
403
];
const
E103
=
[
103
,
'请勿重复创建'
,
403
];
const
E103
=
[
103
,
'请勿重复创建'
,
403
];
const
E104
=
[
104
,
'该用户不存在或属于您的团队'
,
403
];
const
E104
=
[
104
,
'该用户不存在或属于您的团队'
,
403
];
...
...
src/Seller/Lib/SellerInterface.php
View file @
c2004a11
...
@@ -6,13 +6,14 @@
...
@@ -6,13 +6,14 @@
* Time: 16:28
* Time: 16:28
*/
*/
namespace
Hdll\Services\S
tore
\Lib
;
namespace
Hdll\Services\S
eller
\Lib
;
use
Swoft\Core\ResultInterface
;
use
Swoft\Core\ResultInterface
;
/**
/**
* @method ResultInterface deferSave($referId, $unionId, $openId, $nickName, $headImgUrl, $realName, $phoneNumber)
* @method ResultInterface deferSave($referId, $unionId, $openId, $nickName, $headImgUrl, $realName, $phoneNumber)
* @method ResultInterface deferGet($id)
* @method ResultInterface deferGet($id,$fields=['*'])
* @method ResultInterface deferUpdate($id)
* Interface SellerInterface
* Interface SellerInterface
* @package App\Lib
* @package App\Lib
*/
*/
...
@@ -33,10 +34,26 @@ interface SellerInterface
...
@@ -33,10 +34,26 @@ interface SellerInterface
public
function
save
(
$referId
,
$unionId
,
$openId
,
$nickName
,
$headImgUrl
,
$realName
=
''
,
$phoneNumber
=
''
);
public
function
save
(
$referId
,
$unionId
,
$openId
,
$nickName
,
$headImgUrl
,
$realName
=
''
,
$phoneNumber
=
''
);
/**
/**
* @param $id
* @param $id
* @param array $fields
* @return mixed
* @return mixed
* @author Administrator
* @author Administrator
*/
*/
public
function
get
(
$id
);
public
function
get
(
$id
,
$fields
=
[
'*'
]);
/**
* @param $condition
* @param $data
* $data['referId']=>'来源ID'
* $data['unionId']=>'unionId'
* $data['openId']=>'openId'
* $data['nickName']=>'昵称'
* $data['headImgUrl']=>'头像URL'
* $data['realName']=>'真实姓名'
* $data['phoneNumber']=>'手机号'
* @return mixed
* @author Administrator
*/
public
function
update
(
$condition
,
$data
);
}
}
\ No newline at end of file
src/SellerDistribution/Enum/SellerDistributionError.php
0 → 100644
View file @
c2004a11
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/17
* Time: 14:19
*/
namespace
Hdll\Services\SellerDistribution\Enum
;
class
SellerDistributionError
{
const
E001
=
[
001
,
'参数非法'
,
400
];
const
E002
=
[
002
,
'无效的Token'
,
403
];
const
E003
=
[
003
,
'无权限操作'
,
403
];
const
E004
=
[
004
,
'数据不存在'
,
404
];
const
E101
=
[
101
,
'微信支付错误'
,
500
];
const
E102
=
[
102
,
'订单不存在或状态异常'
,
404
];
const
E103
=
[
103
,
'升级VIP失败,没有找到对应的店铺'
,
404
];
public
function
getError
(
$code
)
{
$reflect
=
new
\ReflectionClass
(
self
::
class
);
$arr
=
$reflect
->
getConstant
(
'E'
.
substr
(
$code
,
-
3
));
if
(
!
is_array
(
$arr
))
{
return
false
;
}
return
[
'code'
=>
$arr
[
0
],
'msg'
=>
$arr
[
1
],
'errorCode'
=>
$arr
[
2
],
];
}
}
\ No newline at end of file
src/SellerDistribution/Lib/SellerDistributionInterface.php
0 → 100644
View file @
c2004a11
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/25
* Time: 14:00
*/
namespace
Hdll\Services\SellerDistribution\Lib
;
use
Swoft\Core\ResultInterface
;
/**
* @method ResultInterface deferSaveBill($orderId, $sellerId, $money, $level, $memo = '')
* @method ResultInterface deferSaveCommission($sellerId, $orderId, $money)
* Interface SellerDistributionInterface
* @package App\Lib
*/
interface
SellerDistributionInterface
{
/**
* 保存账单
* @param $orderId
* @param $sellerId
* @param $money
* @param $level
* @param string $memo
* @return mixed
* @author Administrator
*/
public
function
saveBill
(
$orderId
,
$sellerId
,
$money
,
$level
,
$memo
=
''
);
/**
* 保存佣金记录
* @param $sellerId
* @param $orderId
* @param $money
* @return mixed
* @author Administrator
*/
public
function
saveCommission
(
$sellerId
,
$orderId
,
$money
);
}
\ No newline at end of file
src/Store/Lib/StoreInterface.php
View file @
c2004a11
...
@@ -34,7 +34,7 @@ interface StoreInterface
...
@@ -34,7 +34,7 @@ interface StoreInterface
* 根据店铺ID获取店铺信息
* 根据店铺ID获取店铺信息
*
*
* @param integer $storeId
* @param integer $storeId
* @return
null|array
* @return
array 空数组表示没有查询到记录
*/
*/
public
function
getStore
(
int
$storeId
);
public
function
getStore
(
int
$storeId
);
...
...
src/Store/Lib/TemplateInterface.php
0 → 100644
View file @
c2004a11
<?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\Store\Lib
;
use
Swoft\Core\ResultInterface
;
/**
* The interface of store-template service
*
* @method ResultInterface deferGetTemplateList(int $onshelf = 1)
* @method ResultInterface deferGetTemplate(int $tplId)
* @method ResultInterface deferDelTemplate(int $tplId)
* @method ResultInterface deferUpdateTemplate(int $tplId, array $data)
* @method ResultInterface deferAddTemplate($data)
*/
interface
TemplateInterface
{
/**
* 获取所有可用的个性模板列表
* onshelf=1表示查询已上架的模板
* onshelf=2表示查询已下架的模板
*
* @Number(name="onshelf")
* @param int $onshelf
* @return array
*/
public
function
getTemplateList
(
int
$onshelf
=
1
);
/**
* 根据模板ID获取单个模板信息
*
* @Number(name="tplId")
* @param integer $tplId
* @return array
*/
public
function
getTemplate
(
int
$tplId
);
/**
* 根据模板id删除一个模板
*
* @Number(name="tplId")
* @param integer $tplId
* @return int 返回删除成功的条数
*/
public
function
delTemplate
(
int
$tplId
);
/**
* 根据模板id更新一个模板
* $data 字段说明:
* ['tplThumb'] => 模板缩略图地址
* ['title'] => 模板标题
* ['onshelf'] => 是否上架,1上架,2下架,下架的模板用户看不到
* ['memo'] => 备注信息,此信息用户看不到
* ['orderby'] => 排序值,值越大,越靠前
*
* @Number(name="tplId")
* @param integer $tplId
* @param array $data
* @return int 返回更新成功的条数
*/
public
function
updateTemplate
(
int
$tplId
,
array
$data
);
/**
* 添加一个模板
* $data 字段说明:
* ['tplThumb'] => 模板缩略图地址
* ['title'] => 模板标题
* ['onshelf'] => 是否上架,1上架,2下架,下架的模板用户看不到
* ['memo'] => 备注信息,此信息用户看不到
* ['orderby'] => 排序值,值越大,越靠前
*
* @param array $data
* @return int 返回新建模板id
*/
public
function
addTemplate
(
$data
);
}
\ No newline at end of file
src/Vip/Enum/VipEnum.php
0 → 100644
View file @
c2004a11
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/30
* Time: 10:32
*/
namespace
Hdll\Services\Vip\Enum
;
class
VipEnum
{
const
VIP_TOTAL_FEE
=
10
;
//价格
const
PAY_NOTIFY
=
'http://www.baidu.com'
;
const
STATUS_UNPAID
=
10
;
//未支付
const
STATUS_PAID
=
20
;
//已支付
}
\ 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