post(); $params['user_id'] = $this->userId; $pageSize = request()->post('pageSize', 15); $datas = PaperService::make()->getDataList($params, $pageSize); return message(1010, true, $datas); } /** * 详情 */ public function info() { try { $params = request()->all(); $id = isset($params['id'])? intval($params['id']) : 0; if(empty($id)){ return message(1036, false); } if($info = PaperService::make()->getInfo($this->userId, $id, $params)){ return message(1010, true, $info); }else{ return message(1009, false); } }catch (\Exception $exception){ $error = ['error' => $exception->getMessage(), 'trace' => $exception->getTrace()]; return message(1009, false, $error); } } /** * 试题纠错 * @return array */ public function error() { try { $params = request()->all(); if ($result = PaperService::make()->submitError($this->userId, $params)) { return showJson(PaperService::make()->getError(), true, $result); } else { return showJson(PaperService::make()->getError(), false); } } catch (\Exception $exception) { $error = ['error' => $exception->getMessage(), 'trace' => $exception->getTrace()]; return message(1003, false, $error); } } }