50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Request\DiseaseRequest;
|
|
use App\Services\DiseaseService;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
class DiseaseController extends AbstractController
|
|
{
|
|
/**
|
|
* 专长列表
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getDiseaseExpertiseList(): ResponseInterface
|
|
{
|
|
$DiseaseService = new DiseaseService();
|
|
$data = $DiseaseService->getDiseaseExpertiseList();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 搜索疾病分类
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getDiseaseSearch(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(DiseaseRequest::class);
|
|
$request->scene('getDiseaseSearch')->validateResolved();
|
|
|
|
$DiseaseService = new DiseaseService();
|
|
$data = $DiseaseService->getDiseaseSearch();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取常见疾病分类
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getDiseaseHot(): ResponseInterface
|
|
{
|
|
$DiseaseService = new DiseaseService();
|
|
$data = $DiseaseService->getDiseaseHot();
|
|
return $this->response->json($data);
|
|
}
|
|
} |