75 lines
2.3 KiB
PHP
75 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Request\DoctorAuthRequest;
|
|
use App\Request\UserDoctorRequest;
|
|
use App\Services\DoctorAuthService;
|
|
use App\Services\DoctorInquiryService;
|
|
use App\Services\UserDoctorService;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
class UserDoctorController extends AbstractController
|
|
{
|
|
/**
|
|
* 获取医生专长列表
|
|
* 身份认证
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getAuthDoctorExpertise(): ResponseInterface
|
|
{
|
|
$UserDoctorService = new UserDoctorService();
|
|
$data = $UserDoctorService->getAuthDoctorExpertise();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取医生问诊配置
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getInquiryConfig(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserDoctorRequest::class);
|
|
$request->scene('getInquiryConfig')->validateResolved();
|
|
|
|
$DoctorInquiryService = new DoctorInquiryService();
|
|
$data = $DoctorInquiryService->getInquiryConfig();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 医生问诊开关
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function putInquiryOpen(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserDoctorRequest::class);
|
|
$request->scene('putInquiryOpen')->validateResolved();
|
|
|
|
$DoctorInquiryService = new DoctorInquiryService();
|
|
$data = $DoctorInquiryService->putInquiryOpen();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 修改医生问诊配置
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function putInquiryConfig(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserDoctorRequest::class);
|
|
$request->scene('putInquiryConfig')->validateResolved();
|
|
|
|
$DoctorInquiryService = new DoctorInquiryService();
|
|
$data = $DoctorInquiryService->putInquiryConfig();
|
|
return $this->response->json($data);
|
|
}
|
|
} |