From e9ba9fae734847906385452dd883cf16d9518c36 Mon Sep 17 00:00:00 2001
From: lisida <506400117@qq.com>
Date: Thu, 14 Feb 2019 17:41:52 +0800
Subject: [PATCH] test
---
src/Server/JsonRpcTool.php | 16 +++++++++++++++-
src/views/doc.blade.php | 4 ++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/Server/JsonRpcTool.php b/src/Server/JsonRpcTool.php
index 1297ab9..a195c04 100644
--- a/src/Server/JsonRpcTool.php
+++ b/src/Server/JsonRpcTool.php
@@ -4,6 +4,7 @@ namespace JsonRpc\Server;
use Illuminate\Http\Request;
use Illuminate\View\Factory;
+use itxq\apidoc\BootstrapApiDoc;
use JsonRpc\Exception\RpcServerException;
use Monolog\Logger;
@@ -50,8 +51,21 @@ class JsonRpcTool
);
}
}
+ $methods = [];
+ foreach ($this->config['map'] as $key => $item) {
+ if (!in_array($item[0], $methods)) {
+ $methods[] = $item[0];
+ }
+ }
+ $config = [
+ 'class' => $methods,
+ 'filter_method' => [],
+ ];
+
+ $api = new BootstrapApiDoc($config);
+ $data = $api->getApiDocTmp();
$methods = $this->getMethods();
- $view->share('method', $method);
+ $view->share('data',json_encode($data));
$view->share('endpoint', $this->getEndpoint());
$view->share('methods', $methods);
$view->share('params', json_encode($params, JSON_PRETTY_PRINT));
diff --git a/src/views/doc.blade.php b/src/views/doc.blade.php
index 3320ca9..5b61d8c 100644
--- a/src/views/doc.blade.php
+++ b/src/views/doc.blade.php
@@ -102,5 +102,9 @@
+