67 lines
1.4 KiB
PHP
67 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Controller\AbstractController;
|
|
use App\Middleware\Admin\JwtAuthMiddleware;
|
|
use App\Service\Admin\System\BannerService;
|
|
use Exception;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middlewares;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Hyperf\Validation\Annotation\Scene;
|
|
|
|
#[Controller(prefix: "admin/banner")]
|
|
#[Middlewares([
|
|
JwtAuthMiddleware::class,
|
|
])]
|
|
class BannerController extends AbstractController
|
|
{
|
|
/**
|
|
* banner
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "add", methods: "POST")]
|
|
#[Scene(scene: "add")]
|
|
public function add()
|
|
{
|
|
return (new BannerService)->add();
|
|
}
|
|
|
|
/**
|
|
* banner
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "edit", methods: "POST")]
|
|
#[Scene(scene: "edit")]
|
|
public function edit()
|
|
{
|
|
return (new BannerService)->edit();
|
|
}
|
|
|
|
/**
|
|
* banner
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "list", methods: "GET")]
|
|
#[Scene(scene: "list")]
|
|
public function list()
|
|
{
|
|
return (new BannerService)->handle();
|
|
}
|
|
|
|
/**
|
|
* banner
|
|
* @return array
|
|
* @throws Exception
|
|
*/
|
|
#[RequestMapping(path: "del", methods: "GET")]
|
|
#[Scene(scene: "del")]
|
|
public function del(): array
|
|
{
|
|
return (new BannerService)->del();
|
|
}
|
|
}
|