get(); $list = $this->service->getList($param,'*',$param['page']??0,$param['limit']??0); return successTrans("success.data",$list); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } /** * 拒绝 * @param $id * @return mixed */ #[Route(path: "refuse/{id}",methods: "post")] public function refuse(Request $request,$id) { try { if(!$id) return errorTrans('缺少参数'); $param = $request->post(); if (!$this->validate->check($param)) return error($this->validate->getError()); $param = $this->validate->checked($param); $state = $this->service->refuse($id,$param['fail_msg']); if(!$state) return errorTrans('error.data'); return successTrans("success.data"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } /** * 通过 * @param $id * @return mixed */ #[Route(path: "adopt/{id}",methods: "post")] public function adopt(Request $request,$id) { try { if(!$id) return errorTrans('缺少参数'); $state = $this->service->adopt($id); if(!$state) return errorTrans('error.data'); return successTrans("success.data"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }