request->post(); try { validate(Page::class)->check($page); }catch (ValidateException $e){ $page["page"]=1; $page["size"] = 10; } try { return $this->JsonSucess(UserService::getUserInfoList($page, getXzqdmSub())); } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) { return $this->JsonError($dbE); } } /** * @Apidoc\Author("yang") * @throws ModelNotFoundException * @throws DataNotFoundException * @throws DbException * @Apidoc\Title("网格人员信息添加") * @Apidoc\Tag("网格人员") * @Apidoc\Method ("POST") * @Route("/addgridperson",method="POST") * @Middleware({"jwt"}) */ public function addGridPerson(): Json{ $data = $this->request->post(); try { //validate(gridPersonInfo::class)->check($data); $data['creation_time'] = date('Y-m-d h:i:s', time()); return $this->JsonSucess(UserService::saveUserInfo($data)); }catch (ValidateException $e){ return $this->JsonError($e->getError()); } } /** * @Apidoc\Author("yang") * @throws ModelNotFoundException * @throws DataNotFoundException * @throws DbException * @Apidoc\Title("通过id获取网格人员信息") * @Apidoc\Tag("网格人员") * @Apidoc\Method ("GET") * @Route("/getgridpersonbyid",method="GET") * @Middleware({"jwt"}) */ public function getGridPersoninfoById(): Json{ $data = $this->request->get(); try { //validate(gridPersonInfo::class)->check($data); return $this->JsonSucess(UserService::getgridpersonInfoById($data['id'])); }catch (ValidateException $e){ return $this->JsonError($e->getError()); } } /** * @Apidoc\Author("yang") * @throws ModelNotFoundException * @throws DataNotFoundException * @throws DbException * @Apidoc\Title("网格人员信息修改") * @Apidoc\Tag("网格人员") * @Apidoc\Method ("POST") * @Route("/editgridperson",method="POST") * @Middleware({"jwt"}) */ public function editGridPersoninfoById(): Json{ $data = $this->request->post(); try { //validate(gridPersonInfo::class)->check($data); $data['last_update_time'] = date('Y-m-d h:i:s', time()); return $this->JsonSucess(UserService::editUserInfoById($data['id'],$data)); }catch (ValidateException $e){ return $this->JsonError($e->getError()); } } /** * @Apidoc\Author("yang") * @throws ModelNotFoundException * @throws DataNotFoundException * @throws DbException * @Apidoc\Title("通过id删除网格人员信息") * @Apidoc\Tag("网格人员") * @Apidoc\Method ("GET") * @Route("/deletegridperson",method="GET") * @Middleware({"jwt"}) */ public function deleteGridPersoninfoById(): Json{ $data = $this->request->get(); try { //validate(gridPersonInfo::class)->check($data); $data['last_update_time'] = date('Y-m-d h:i:s', time()); return $this->JsonSucess(UserService::deleteUserInfoById($data['id'])); }catch (ValidateException $e){ return $this->JsonError($e->getError()); } } }