68 lines
1.6 KiB
PHP
68 lines
1.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Api;
|
|
|
|
use App\Controller\AbstractController;
|
|
use App\Middleware\Api\JwtAuthMiddleware;
|
|
use App\Service\Api\Driver\AbnormalReportingService;
|
|
use App\Service\Api\Driver\DeliverService;
|
|
use App\Service\Api\Driver\GetSiteListService;
|
|
use App\Service\Api\Driver\LoadActionService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middlewares;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Hyperf\Validation\Annotation\Scene;
|
|
|
|
#[Controller(prefix: 'api/driver')]
|
|
#[Middlewares([
|
|
JwtAuthMiddleware::class,
|
|
])]
|
|
class DriverController extends AbstractController
|
|
{
|
|
/**
|
|
* 获取信息
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: 'get_site_list',methods: 'GET')]
|
|
#[Scene(scene: 'get_site_list')]
|
|
public function get_site_list()
|
|
{
|
|
return (new GetSiteListService)->handle();
|
|
}
|
|
|
|
/**
|
|
* 装车出餐
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: 'load_action',methods: 'GET')]
|
|
#[Scene(scene: 'load_action')]
|
|
public function load_action()
|
|
{
|
|
return (new LoadActionService)->handle();
|
|
}
|
|
|
|
/**
|
|
* 异常上报
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: 'abnormal_reporting',methods: 'POST')]
|
|
#[Scene(scene: 'abnormal_reporting')]
|
|
public function abnormal_reporting()
|
|
{
|
|
return (new AbnormalReportingService)->handle();
|
|
}
|
|
|
|
/**
|
|
* 送达
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: 'deliver',methods: 'GET')]
|
|
#[Scene(scene: 'deliver')]
|
|
public function deliver()
|
|
{
|
|
return (new DeliverService)->handle();
|
|
}
|
|
}
|