新增家庭成员接口、修正医生名片
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Controller;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Request\PatientFamilyRequest;
|
||||
use App\Services\PatientFamilyService;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hyperf\Validation\Contract\ValidatorFactoryInterface;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
@@ -32,11 +33,12 @@ class PatientFamilyController extends AbstractController
|
||||
|
||||
/**
|
||||
* 新增家庭成员
|
||||
* @return array|ResponseInterface
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function addFamily(): array|ResponseInterface
|
||||
public function addFamily(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(PatientFamilyRequest::class);
|
||||
$request->scene('addFamily')->validateResolved();
|
||||
@@ -44,7 +46,7 @@ class PatientFamilyController extends AbstractController
|
||||
// 检测入参身份证号
|
||||
$res = $this->checkRequestIdCard();
|
||||
if (!empty($res)) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, $res);
|
||||
return $this->response->json(fail(HttpEnumCode::HTTP_ERROR, $res));
|
||||
}
|
||||
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
@@ -52,6 +54,155 @@ class PatientFamilyController extends AbstractController
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改家庭成员
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function editFamily(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(PatientFamilyRequest::class);
|
||||
$request->scene('editFamily')->validateResolved();
|
||||
|
||||
// 检测入参身份证号
|
||||
$res = $this->checkRequestIdCard();
|
||||
if (!empty($res)) {
|
||||
return $this->response->json(fail(HttpEnumCode::HTTP_ERROR, $res));
|
||||
}
|
||||
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->editFamily();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除家庭成员
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function deleteFamily(): ResponseInterface
|
||||
{
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->deleteFamily();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取家庭成员详情
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getFamily(): ResponseInterface
|
||||
{
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->getFamily();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取家庭成员详情-个人情况
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getFamilyPersonal(): ResponseInterface
|
||||
{
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->getFamilyPersonal();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改家庭成员-个人情况
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function editFamilyPersonal(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(PatientFamilyRequest::class);
|
||||
$request->scene('editFamilyPersonal')->validateResolved();
|
||||
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->editFamilyPersonal();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增家庭成员-个人情况
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function addFamilyPersonal(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(PatientFamilyRequest::class);
|
||||
$request->scene('addFamilyPersonal')->validateResolved();
|
||||
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->addFamilyPersonal();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取家庭成员-健康状况
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getFamilyHealth(): ResponseInterface
|
||||
{
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->getFamilyHealth();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改家庭成员-健康情况
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function editFamilyHealth(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(PatientFamilyRequest::class);
|
||||
$request->scene('editFamilyHealth')->validateResolved();
|
||||
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->editFamilyHealth();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增家庭成员-健康情况
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function addFamilyHealth(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(PatientFamilyRequest::class);
|
||||
$request->scene('addFamilyHealth')->validateResolved();
|
||||
|
||||
$patientFamilyService = new PatientFamilyService();
|
||||
|
||||
$data = $patientFamilyService->addFamilyHealth();
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检测入参身份证号
|
||||
* @return string
|
||||
|
||||
Reference in New Issue
Block a user