prolab-api/api/modules/v1/controllers/LisResultController.php

58 lines
1.4 KiB
PHP
Raw Normal View History

2025-09-24 06:24:52 +00:00
<?php
namespace api\modules\v1\controllers;
use api\components\Controller;
use Yii;
2025-10-06 02:45:52 +00:00
use api\models\search\LisResultSearch;
2025-10-05 05:14:26 +00:00
use OpenApi\Annotations as OA;
/**
* @OA\Tag(
2025-10-06 02:45:52 +00:00
* name="LisResult",
2025-10-05 05:14:26 +00:00
* description="LIS Result endpoints"
* )
*/
2025-10-06 02:45:52 +00:00
class LisResultController extends Controller
2025-09-24 06:24:52 +00:00
{
2025-10-04 09:16:19 +00:00
2025-10-05 05:14:26 +00:00
/**
* @OA\Get(
2025-10-06 02:45:52 +00:00
* path="/lis-result",
2025-10-05 05:14:26 +00:00
* summary="Get list LIS Result",
2025-10-06 02:45:52 +00:00
* operationId="LisResultIndex",
* tags={"LisResult"},
2025-10-05 05:14:26 +00:00
* security={{"bearerAuth": {}}},
* @OA\Response(
* response=200,
* description="OK",
* @OA\JsonContent(
* type="object",
* @OA\Property(property="count", type="integer", example=10),
* @OA\Property(
* property="dataModels",
* type="array",
2025-10-06 02:45:52 +00:00
* @OA\Items(ref="#/components/schemas/LisResult")
2025-10-05 05:14:26 +00:00
* ),
* @OA\Property(property="total", type="integer", example=100)
* )
* ),
* @OA\Response(
* response=401,
* description="Unauthorized",
* @OA\JsonContent(ref="#/components/schemas/Unauthorized")
* )
* )
*/
2025-09-24 06:24:52 +00:00
public function actionIndex()
{
2025-10-06 02:45:52 +00:00
$search['LisResultSearch'] = Yii::$app->request->queryParams;
$searchModel = new LisResultSearch();
2025-09-24 06:24:52 +00:00
$dataProvider = $searchModel->search($search);
return $this->apiCollection([
'count' => $dataProvider->count,
'dataModels' => $dataProvider->models,
], $dataProvider->totalCount);
}
2025-10-06 02:15:02 +00:00
}