Api文档
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
937 B

1 year ago
<?php
namespace Plugins\ApiDoc\Controller;
1 year ago
use App\Util\Response;
1 year ago
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Hyperf\View\Render;
1 year ago
use Plugins\ApiDoc\Service\ApiDocService;
1 year ago
use Psr\Http\Message\ResponseInterface;
/**
* 文档控制器
*
* Class DocumentController
*/
#[Controller('admin/plugins/api-doc')]
class DocumentController
{
/**
* @param Render $render
*
* @return ResponseInterface
*/
#[GetMapping(path: 'view')]
public function view(Render $render): ResponseInterface
{
return $render->render("plugins.ApiDoc.Document.view");
}
1 year ago
/**
* 文档数据
*
* @return ResponseInterface
* @throws \Exception
*/
#[GetMapping(path: 'doc-data')]
public function doc(): ResponseInterface
{
return Response::json()->success(
ApiDocService::aop(false)->get()
);
}
1 year ago
}