39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Request\DetectionRequest;
|
|
use App\Services\DetectionService;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
class DetectionController extends AbstractController
|
|
{
|
|
/**
|
|
* 获取合作公司检测项目列表
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getDetectionProjectList(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(DetectionRequest::class);
|
|
$request->scene('getDetectionProjectList')->validateResolved();
|
|
|
|
$detectionService = new DetectionService();
|
|
$data = $detectionService->getDetectionProjectList();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取合作公司检测项目详情
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getDetectionProject(): ResponseInterface
|
|
{
|
|
$detectionService = new DetectionService();
|
|
$data = $detectionService->getDetectionProject();
|
|
return $this->response->json($data);
|
|
}
|
|
} |