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
6a8df925
Commit
6a8df925
authored
Aug 02, 2018
by
zhufx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.买家错误信息
2.买家钱包接口 3.买家连接池配置
parent
5c658fbc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
5 deletions
+60
-5
src/Buyer/Enum/BuyerError.php
+3
-0
src/Buyer/Lib/CommissionInterface.php
+37
-0
src/Common/Pool/Config/BuyerPoolConfig.php
+20
-5
No files found.
src/Buyer/Enum/BuyerError.php
View file @
6a8df925
...
@@ -14,6 +14,9 @@ class BuyerError
...
@@ -14,6 +14,9 @@ class BuyerError
const
DB_ERROR
=
[
"msg"
=>
"数据库操作错误"
,
"code"
=>
500
,
"errorCode"
=>
24102
];
const
DB_ERROR
=
[
"msg"
=>
"数据库操作错误"
,
"code"
=>
500
,
"errorCode"
=>
24102
];
const
SCORE_ERR
=
[
"msg"
=>
"你无权创建该用户"
,
"code"
=>
403
,
"errorCode"
=>
24103
];
const
SCORE_ERR
=
[
"msg"
=>
"你无权创建该用户"
,
"code"
=>
403
,
"errorCode"
=>
24103
];
const
NOT_FOUND_COMMISSION
=
[
"msg"
=>
"获取佣金信息失败"
,
"code"
=>
404
,
"errorCode"
=>
24104
];
const
INSUFFICIENT_COMMISSION
=
[
"msg"
=>
"可提现金额不足,无法提现"
,
"code"
=>
400
,
"errorCode"
=>
24105
];
public
static
function
atranslate
(
$message
,
$param
)
public
static
function
atranslate
(
$message
,
$param
)
{
{
...
...
src/Buyer/Lib/CommissionInterface.php
0 → 100644
View file @
6a8df925
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/2
* Time: 9:49
*/
namespace
Hdll\Services\Buyer\Lib
;
/**
* Interface CommissionInterface
* @package Hdll\Services\Buyer\Lib
*/
interface
CommissionInterface
{
/**
* 扣除可提现金额
*
* @param $storeId
* @param $buyerId
* @param $money
* @return bool
*/
public
function
reduceBalanceCommission
(
$storeId
,
$buyerId
,
$money
);
/**
* 增加可提现金额
*
* @param $storeId
* @param $buyerId
* @param $money
* @return bool
*/
public
function
addBalanceCommission
(
$storeId
,
$buyerId
,
$money
);
}
\ No newline at end of file
src/Common/Pool/Config/BuyerPoolConfig.php
View file @
6a8df925
...
@@ -8,9 +8,10 @@
...
@@ -8,9 +8,10 @@
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
*/
namespace
Hdll\Services\Common
\Pool\Config
;
namespace
App
\Pool\Config
;
use
Swoft\Bean\Annotation\Bean
;
use
Swoft\Bean\Annotation\Bean
;
use
Swoft\Bean\Annotation\Value
;
use
Swoft\Pool\PoolProperties
;
use
Swoft\Pool\PoolProperties
;
/**
/**
...
@@ -20,12 +21,18 @@ use Swoft\Pool\PoolProperties;
...
@@ -20,12 +21,18 @@ use Swoft\Pool\PoolProperties;
*/
*/
class
BuyerPoolConfig
extends
PoolProperties
class
BuyerPoolConfig
extends
PoolProperties
{
{
/**
protected
$name
=
'buyer'
;
* the name of pool
*
* @Value(name="${config.service.user.name}", env="${USER_POOL_NAME}")
* @var string
*/
protected
$name
=
''
;
/**
/**
* Minimum active number of connections
* Minimum active number of connections
*
*
* @Value(name="${config.service.user.minActive}", env="${USER_POOL_MIN_ACTIVE}")
* @var int
* @var int
*/
*/
protected
$minActive
=
5
;
protected
$minActive
=
5
;
...
@@ -33,6 +40,7 @@ class BuyerPoolConfig extends PoolProperties
...
@@ -33,6 +40,7 @@ class BuyerPoolConfig extends PoolProperties
/**
/**
* the maximum number of active connections
* the maximum number of active connections
*
*
* @Value(name="${config.service.user.maxActive}", env="${USER_POOL_MAX_ACTIVE}")
* @var int
* @var int
*/
*/
protected
$maxActive
=
50
;
protected
$maxActive
=
50
;
...
@@ -40,6 +48,7 @@ class BuyerPoolConfig extends PoolProperties
...
@@ -40,6 +48,7 @@ class BuyerPoolConfig extends PoolProperties
/**
/**
* the maximum number of wait connections
* the maximum number of wait connections
*
*
* @Value(name="${config.service.user.maxWait}", env="${USER_POOL_MAX_WAIT}")
* @var int
* @var int
*/
*/
protected
$maxWait
=
100
;
protected
$maxWait
=
100
;
...
@@ -47,6 +56,7 @@ class BuyerPoolConfig extends PoolProperties
...
@@ -47,6 +56,7 @@ class BuyerPoolConfig extends PoolProperties
/**
/**
* Maximum waiting time
* Maximum waiting time
*
*
* @Value(name="${config.service.user.maxWaitTime}", env="${USER_POOL_MAX_WAIT_TIME}")
* @var int
* @var int
*/
*/
protected
$maxWaitTime
=
3
;
protected
$maxWaitTime
=
3
;
...
@@ -54,6 +64,7 @@ class BuyerPoolConfig extends PoolProperties
...
@@ -54,6 +64,7 @@ class BuyerPoolConfig extends PoolProperties
/**
/**
* Maximum idle time
* Maximum idle time
*
*
* @Value(name="${config.service.user.maxIdleTime}", env="${USER_POOL_MAX_IDLE_TIME}")
* @var int
* @var int
*/
*/
protected
$maxIdleTime
=
60
;
protected
$maxIdleTime
=
60
;
...
@@ -61,6 +72,7 @@ class BuyerPoolConfig extends PoolProperties
...
@@ -61,6 +72,7 @@ class BuyerPoolConfig extends PoolProperties
/**
/**
* the time of connect timeout
* the time of connect timeout
*
*
* @Value(name="${config.service.user.timeout}", env="${USER_POOL_TIMEOUT}")
* @var int
* @var int
*/
*/
protected
$timeout
=
200
;
protected
$timeout
=
200
;
...
@@ -75,15 +87,16 @@ class BuyerPoolConfig extends PoolProperties
...
@@ -75,15 +87,16 @@ class BuyerPoolConfig extends PoolProperties
* ]
* ]
* </pre>
* </pre>
*
*
* @var array
*/
*/
protected
$uri
=
[
protected
$uri
=
[
'192.168.3.100:8101'
,
"127.0.0.1:8099"
];
];
/**
/**
* whether to user provider(consul/etcd/zookeeper)
* whether to user provider(consul/etcd/zookeeper)
*
*
* @Value(name="${config.service.user.useProvider}", env="${USER_POOL_USE_PROVIDER}")
* @var bool
* @var bool
*/
*/
protected
$useProvider
=
false
;
protected
$useProvider
=
false
;
...
@@ -91,6 +104,7 @@ class BuyerPoolConfig extends PoolProperties
...
@@ -91,6 +104,7 @@ class BuyerPoolConfig extends PoolProperties
/**
/**
* the default balancer is random balancer
* the default balancer is random balancer
*
*
* @Value(name="${config.service.user.balancer}", env="${USER_POOL_BALANCER}")
* @var string
* @var string
*/
*/
protected
$balancer
=
''
;
protected
$balancer
=
''
;
...
@@ -98,6 +112,7 @@ class BuyerPoolConfig extends PoolProperties
...
@@ -98,6 +112,7 @@ class BuyerPoolConfig extends PoolProperties
/**
/**
* the default provider is consul provider
* the default provider is consul provider
*
*
* @Value(name="${config.service.user.provider}", env="${USER_POOL_PROVIDER}")
* @var string
* @var string
*/
*/
protected
$provider
=
''
;
protected
$provider
=
''
;
...
...
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