Merge branch 'master' of git.int.haowumc.com:composer/php-json-rpc
This commit is contained in:
commit
e9c8c818b3
16
README.md
16
README.md
|
@ -170,3 +170,19 @@ http://host/rpc/doc.html 文档地址
|
|||
严格使用系统定义错误码 详见json-rpc/src/Server/JsonRpcBase.php
|
||||
|
||||
###更新日志
|
||||
|
||||
###文档注释格式
|
||||
```
|
||||
/**
|
||||
* @title 用户登录API
|
||||
* @url https://wwww.baidu.com/login
|
||||
* @method POST
|
||||
* @param 类型 字段名称 描述 默认 是否必须
|
||||
* @param string password 密码 空 必须
|
||||
* @code 1 成功
|
||||
* @code 2 失败
|
||||
* @return int code 状态码(具体参见状态码说明)
|
||||
* @return string msg 提示信息
|
||||
*/
|
||||
|
||||
```
|
||||
|
|
|
@ -35,11 +35,15 @@ return [
|
|||
],
|
||||
'api' => [
|
||||
'local' => true,
|
||||
'base_uri' => env('RPC_API_URI','http://api.dev.haowumc.com'),
|
||||
'base_uri' => env('RPC_API_URI','http://sapi.dev.haowumc.com'),
|
||||
],
|
||||
'op' => [
|
||||
'local' => true,
|
||||
'base_uri' => env('RPC_OP_URI','http://op.dev.haowumc.com'),
|
||||
],
|
||||
'payment' => [
|
||||
'local' => true,
|
||||
'base_uri' => env('RPC_PAYMENT_URI','http://payapi.dev.haowumc.com'),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -35,7 +35,7 @@ class Client
|
|||
public function __construct($config)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->id = app('request')->header('X-Request-Id') ?: "no-x-request-id";
|
||||
$this->id = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -131,8 +131,7 @@ class Client
|
|||
*/
|
||||
protected function id()
|
||||
{
|
||||
// return $this->id.'-'.time();
|
||||
return $this->id;
|
||||
return $this->id++;
|
||||
}
|
||||
|
||||
}
|
|
@ -30,7 +30,7 @@ class BaseServiceProvider extends ServiceProvider
|
|||
$this->setupConfig();
|
||||
$this->app->singleton("rpc.logger", function () {
|
||||
$config = config('rpc');
|
||||
$stream = new StreamHandler($this->app->storagePath() . $config['log_path']);
|
||||
$stream = new StreamHandler($config['log_path']);
|
||||
$stream->setFormatter(new $config['log_formatter']());
|
||||
$logger = new Logger('RPC.LOGGER');
|
||||
return $logger->pushHandler($stream);
|
||||
|
|
|
@ -25,11 +25,6 @@ class JsonRpcMethod extends JsonRpcBase
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $code
|
||||
* @param $msg
|
||||
* @return array
|
||||
*/
|
||||
public function error($code, $msg)
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user