all(); $messages = [ 'id.required' => 'Id必填', ]; $validator = Validator::make($all, [ 'id' => 'required' ], $messages); if ($validator->fails()) { return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]); } $detail = $this->model->find($all['id']); return $this->success($detail); } /** * @OA\Post( * path="/api/admin/course-content-evaluations/save", * tags={"问卷管理"}, * summary="保存", * description="", * @OA\Parameter(name="id", in="query", @OA\Schema(type="integer", format="int64"), required=true, description="课程内容评价字段ID(存在则更新,不存在则新增)"), * @OA\Parameter(name="course_id", in="query", @OA\Schema(type="integer"), required=false, description="课程ID"), * @OA\Parameter(name="course_content_id", in="query", @OA\Schema(type="integer"), required=false, description="课程内容ID"), * @OA\Parameter(name="title", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷标题"), * @OA\Parameter(name="desc", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷描述"), * @OA\Parameter(name="type_id", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷类型ID"), * @OA\Parameter(name="start_time", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷开始时间"), * @OA\Parameter(name="end_time", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷截止时间"), * @OA\Parameter(name="status", in="query", @OA\Schema(type="string", maxLength=255, default="0"), required=false, description="问卷状态(0未发布,1已发布)"), * @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="认证token"), * @OA\Response( * response="200", * description="操作成功" * ) * ) */ public function save() { return parent::save(); } /** * @OA\Get( * path="/api/admin/course-content-evaluations/destroy", * tags={"问卷管理"}, * summary="删除", * description="", * @OA\Parameter(name="id", in="query", @OA\Schema(type="string"), required=true, description="id"), * @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"), * @OA\Response( * response="200", * description="暂无" * ) * ) */ public function destroy() { return parent::destroy(); } }