service = new MasterService(); } /** * 获取用户信息 * @return array|mixed */ public function info(){ $userId = request()->get('id', 0); $info = $this->service->getUserInfo($userId, $this->userId); return message(MESSAGE_OK,true, $info); } /** * 打分 * @return array */ public function score(){ return $this->service->score($this->userId); } /** * 法师申请 * @param MasterValidator $validator * @return array */ public function apply(MasterValidator $validator){ $params = $validator->check(request()->all(),'save'); if(!is_array($params)){ return message($params, false); } return $this->service->apply($this->userId); } /** * 法师列表 * @return mixed */ public function index(){ return $this->service->getDataList($this->userId); } }