feat : banner
This commit is contained in:
66
app/Controller/Admin/BannerController.php
Normal file
66
app/Controller/Admin/BannerController.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Controller\AbstractController;
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Service\Admin\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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user