diff --git a/app/Http/Controllers/Customer/PublicController.php b/app/Http/Controllers/Customer/PublicController.php index 4e9bb4c..07569b6 100644 --- a/app/Http/Controllers/Customer/PublicController.php +++ b/app/Http/Controllers/Customer/PublicController.php @@ -16,14 +16,13 @@ class PublicController extends Controller * @OA\Response( * response="200", * description="获取医院列表", - * ) * ) */ public function getProjects() { - $projects = Project::select("id","name","address")->get(); + $projects = Project::select("id", "name", "address")->get(); return response()->json($projects->toArray()); } @@ -56,10 +55,31 @@ class PublicController extends Controller }); } $pageLength = request()->pageLength ? (int)request()->pageLength : 3; - $data = $data->with(["type"=>function($query) { - $query->select("id","name"); - }])->select("id","type_id","poster","video","published_at")->orderBy("published_at")->paginate($pageLength); + $data = $data->with(["type" => function ($query) { + $query->select("id", "name"); + }])->select("id", "type_id", "title","poster", "video", "published_at")->orderBy("published_at")->paginate($pageLength); return response()->json($data->toArray()); } + /** + * @OA\Get( + * path="/customer/get-training-video/{id}", + * summary="V2-获取单条视频数据", + * description="获取单条视频数据", + * @OA\Parameter(name="id", in="path", @OA\Schema(type="integer"), required=true, description="视频内容ID"), + * @OA\Response( + * response="200", + * description="获取单条视频数据" + * ) + * ) + */ + + public function getTrainingVideo($id) + { + $video = Training::with(["type" => function ($query) { + $query->select("id", "name"); + }])->select("id", "type_id", "title","poster", "video", "published_at")->find($id); + + } + }