Commit 6a8df925 by zhufx

1.买家错误信息

2.买家钱包接口
3.买家连接池配置
parent 5c658fbc
...@@ -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)
{ {
......
<?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
...@@ -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 = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment