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
6a670cb1
Commit
6a670cb1
authored
Jul 31, 2018
by
王召彬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.0x00day.com:10080/hdll/hdll-services
parents
e777865d
c9fc7609
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
207 additions
and
4 deletions
+207
-4
src/BuyerDistribution/Enum/BuyerDistributionError.php
+1
-1
src/Common/Pool/Config/SellerDistributionPoolConfig.php
+104
-0
src/Common/Pool/Config/SellerPoolConfig.php
+1
-1
src/Seller/Enum/SellerError.php
+2
-2
src/SellerDistribution/Enum/SellerDistributionError.php
+37
-0
src/SellerDistribution/Lib/SellerDistributionInterface.php
+42
-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 @
6a670cb1
...
@@ -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/Pool/Config/SellerDistributionPoolConfig.php
0 → 100644
View file @
6a670cb1
<?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.100: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 @
6a670cb1
...
@@ -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:8
101
'
,
'192.168.3.100:8
099
'
,
];
];
/**
/**
...
...
src/Seller/Enum/Seller
DistributionEnum
.php
→
src/Seller/Enum/Seller
Error
.php
View file @
6a670cb1
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
namespace
Hdll\Services\Order\Enum
;
namespace
Hdll\Services\Order\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/SellerDistribution/Enum/SellerDistributionError.php
0 → 100644
View file @
6a670cb1
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/17
* Time: 14:19
*/
namespace
App\Exception
;
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 @
6a670cb1
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/25
* Time: 14:00
*/
namespace
App\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/Vip/Enum/VipEnum.php
0 → 100644
View file @
6a670cb1
<?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