42 lines
1005 B
PHP
42 lines
1005 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Api;
|
|
|
|
use App\Controller\AbstractController;
|
|
use App\Middleware\Api\JwtAuthMiddleware;
|
|
use App\Service\Api\Coupon\CouponListService;
|
|
use App\Service\Api\Coupon\HomePopupsService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middlewares;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Hyperf\Validation\Annotation\Scene;
|
|
|
|
#[Controller(prefix: 'api/coupon')]
|
|
#[Middlewares([
|
|
JwtAuthMiddleware::class,
|
|
])]
|
|
class CouponController extends AbstractController
|
|
{
|
|
/**
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "home_popups", methods: "GET")]
|
|
#[Scene(scene: "home_popups")]
|
|
public function homePopups()
|
|
{
|
|
return (new HomePopupsService)->handle();
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "my_coupon", methods: "GET")]
|
|
#[Scene(scene: "my_coupon")]
|
|
public function myCoupon()
|
|
{
|
|
return (new CouponListService)->handle();
|
|
}
|
|
}
|