test
This commit is contained in:
parent
c27fac903f
commit
e9ba9fae73
|
@ -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));
|
||||
|
|
|
@ -102,5 +102,9 @@
|
|||
<script src="https://cdn.bootcss.com/highlight.js/9.13.1/highlight.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/highlight.js/9.13.1/languages/json.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>
|
||||
var data = <?php echo $data; ?>;
|
||||
console.log(data)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user