Commit a0c1babd by 王召彬

merge

parents f538efe9 3664dc3d
...@@ -9,13 +9,14 @@ namespace Hdll\Services\Buyer\Enum; ...@@ -9,13 +9,14 @@ namespace Hdll\Services\Buyer\Enum;
class BuyerError class BuyerError
{ {
const PARAMETER_ERR = ["msg" => "参数错误", "code" => 400, "errorCode" => 24001, 'rpcCode' => "PARAMETER_ERR"]; const PARAMETER_ERR = ["msg" => "参数错误", "code" => 400, "errorCode" => 24001];
const REGISTERED = ["msg" => "用户已存在,无需创建", "code" => 400, "errorCode" => 24101, "rpcCode" => "REGISTERED"]; const REGISTERED = ["msg" => "用户已存在,无需创建", "code" => 400, "errorCode" => 24101];
const DB_ERROR = ["msg" => "数据库操作错误", "code" => 500, "errorCode" => 24102, "rpcCode" => "DB_ERROR"]; const DB_ERROR = ["msg" => "数据库操作错误", "code" => 500, "errorCode" => 24102];
const SCORE_ERR = ["msg" => "你无权创建该用户", "code" => 403, "errorCode" => 24103, "rpcCode" => "SCORE_ERR"]; const SCORE_ERR = ["msg" => "你无权创建该用户", "code" => 403, "errorCode" => 24103];
const NOT_FOUND_COMMISSION = ["msg" => "获取佣金信息失败", "code" => 404, "errorCode" => 24104, "rpcCode" => "NOT_FOUND_COMMISSION"];
const INSUFFICIENT_COMMISSION = ["msg" => "可提现金额不足,无法提现", "code" => 400, "errorCode" => 24105, "rpcCode" => "INSUFFICIENT_COMMISSION"]; const NOT_FOUND_COMMISSION = ["msg" => "获取佣金信息失败", "code" => 404, "errorCode" => 24104];
const NOT_FOUND_BUYER = ["msg" => "获取买家信息失败", "code" => 400, "errorCode" => 24106, "rpcCode" => "NOT_FOUND_BUYER"]; const INSUFFICIENT_COMMISSION = ["msg" => "可提现金额不足,无法提现", "code" => 400, "errorCode" => 24105];
const NOT_FOUND_BUYER = ["msg" => "未找到用户信息", "code" => 404, "errorCode" => 24106];
public static function atranslate($message,$param) public static function atranslate($message,$param)
......
...@@ -17,7 +17,7 @@ use Swoft\Core\ResultInterface; ...@@ -17,7 +17,7 @@ use Swoft\Core\ResultInterface;
*/ */
interface BuyerInterface interface BuyerInterface
{ {
public function getUser(int $stroeId, int $BuyerId); public function getUser(int $storeId, int $buyerId);
public function updateProfile(string $token, array $data); public function updateProfile(string $token, array $data);
......
...@@ -36,7 +36,7 @@ class CommonException extends Exception ...@@ -36,7 +36,7 @@ class CommonException extends Exception
} }
if ( isset($params['path']) ) { if ( isset($params['path']) ) {
$this->path = $params['path']; $this->path = empty($params['path'])?[]:$params['path'];
} }
......
...@@ -37,9 +37,11 @@ class ExceptionData ...@@ -37,9 +37,11 @@ class ExceptionData
'path' =>[], 'path' =>[],
]; ];
if ( is_callable([$e,"getPath"]) ) { if ( is_callable([$e,"getPath"]) ) {//自建异常类处理path
$data['path'] = json_decode($e->getPath(), true); $data['path'] = json_decode($e->getPath(), true);
} else { //系统异常统一报500错误
$data['code'] = 500;
} }
//获取调用堆栈信息 //获取调用堆栈信息
......
...@@ -21,9 +21,10 @@ class ExceptionParseData ...@@ -21,9 +21,10 @@ class ExceptionParseData
$data = json_decode($msg,true); $data = json_decode($msg,true);
} else { } else {
$data['msg'] = $e->getMessage(); $data['msg'] = $e->getMessage();
$data['code'] = $e->getCode(); $data['code'] = 500;
$data['errorCode'] = -1;
$data['file'] = $e->getFile().' '.$e->getLine(); $data['file'] = $e->getFile().' '.$e->getLine();
$data['path'] = [$e->getFile().' '.$e->getLine()]; $data['path'] = ['Service:'.APP_NAME.$e->getFile().' '.$e->getLine()];
} }
return $data; return $data;
......
...@@ -75,7 +75,7 @@ class BuyerPoolConfig extends PoolProperties ...@@ -75,7 +75,7 @@ class BuyerPoolConfig extends PoolProperties
* *
*/ */
protected $uri = [ protected $uri = [
"192.168.3.100:8106" "192.168.3.100:8101"
]; ];
......
...@@ -14,6 +14,7 @@ use Swoft\Bean\Annotation\Bean; ...@@ -14,6 +14,7 @@ use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties; use Swoft\Pool\PoolProperties;
/** /**
* @Bean()
* the config of service user * the config of service user
*/ */
class OrderPoolConfig extends PoolProperties class OrderPoolConfig extends PoolProperties
......
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