新增职业、民族数据接口
This commit is contained in:
parent
2b121804d0
commit
7c9e3e8094
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Model\BasicNation;
|
||||
use App\Request\BasicDataRequest;
|
||||
use App\Request\DiseaseRequest;
|
||||
use App\Services\BasicDataService;
|
||||
@ -146,8 +147,25 @@ class BasicDataController extends AbstractController
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
public function getNation(){
|
||||
$params = array();
|
||||
// $basic_nation = BasicNation::
|
||||
/**
|
||||
* 获取民族数据
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getNation(): ResponseInterface
|
||||
{
|
||||
$BasicDataService = new BasicDataService();
|
||||
$data = $BasicDataService->getNation();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取职业数据
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getJob(): ResponseInterface
|
||||
{
|
||||
$BasicDataService = new BasicDataService();
|
||||
$data = $BasicDataService->getJob();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,8 @@
|
||||
namespace App\Services;
|
||||
|
||||
use App\Model\BasicBank;
|
||||
use App\Model\BasicJob;
|
||||
use App\Model\BasicNation;
|
||||
use App\Model\DiseaseClass;
|
||||
use App\Model\DiseaseClassExpertise;
|
||||
use App\Model\DiseaseClassIcd;
|
||||
@ -263,4 +265,32 @@ class BasicDataService extends BaseService
|
||||
return success($disease_class_icd->toArray());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取民族数据
|
||||
* @return array
|
||||
*/
|
||||
public function getNation(): array
|
||||
{
|
||||
$params = array();
|
||||
$basic_nation = BasicNation::getList($params);
|
||||
if (empty($basic_nation)){
|
||||
return success();
|
||||
}
|
||||
return success($basic_nation->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取职业数据
|
||||
* @return array
|
||||
*/
|
||||
public function getJob(): array
|
||||
{
|
||||
$params = array();
|
||||
$basic_job = BasicJob::getList($params);
|
||||
if (empty($basic_job)){
|
||||
return success();
|
||||
}
|
||||
return success($basic_job->toArray());
|
||||
}
|
||||
}
|
||||
@ -485,6 +485,9 @@ Router::addGroup('/basic', function () {
|
||||
|
||||
// 获取民族数据
|
||||
Router::get('/nation', [BasicDataController::class, 'getNation']);
|
||||
|
||||
// 获取职业数据
|
||||
Router::get('/job', [BasicDataController::class, 'getJob']);
|
||||
});
|
||||
|
||||
// 获取医生评价
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user