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.
34 lines
846 B
34 lines
846 B
<?php |
|
|
|
namespace Plugins\Notebook\Controller\Admin; |
|
|
|
use App\Util\Hy; |
|
use Hyperf\HttpServer\Annotation\Controller; |
|
use Hyperf\HttpServer\Annotation\GetMapping; |
|
use Hyperf\View\Render; |
|
use Plugins\Notebook\Model\Notebook; |
|
use Psr\Http\Message\ResponseInterface; |
|
use Sc\Util\HtmlStructure\Html\Html; |
|
|
|
/** |
|
* Class SharePreviewController |
|
*/ |
|
#[Controller('plugins/notebook')] |
|
class SharePreviewController |
|
{ |
|
/** |
|
* @param Render $render |
|
* |
|
* @return ResponseInterface |
|
*/ |
|
#[GetMapping(path: 'index')] |
|
public function index(Render $render): ResponseInterface |
|
{ |
|
/** @var Notebook $notebook */ |
|
$notebook = Notebook::where('share_key', Hy::request()->query('key'))->first(); |
|
|
|
return $render->render('plugins.Notebook.Admin.Notebook.share', [ |
|
'notebook' => $notebook |
|
]); |
|
} |
|
} |