初始化提交
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user