success($this->service->getPageList($this->request->all())); } /** * 新增本地模块 * @param ModuleRequest $request * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PutMapping("save"), Permission("setting:module:save"), OperationLog] public function save(ModuleRequest $request): ResponseInterface { $this->service->createModule($request->validated()); return $this->success(); } /** * 启停用模块 * @param ModuleRequest $request * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PostMapping("modifyStatus"), Permission("setting:module:status"), OperationLog] public function modifyStatus(ModuleRequest $request): ResponseInterface { return $this->service->modifyStatus($request->validated()) ? $this->success() : $this->error(); } /** * 安装模块 * @param string $name * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PutMapping("install"), Permission("setting:module:install"), OperationLog] public function install(): ResponseInterface { return $this->service->installModuleData($this->request->input('name')) ? $this->success() : $this->error(); } /** * 卸载删除模块 * @param string $name * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface * @throws \Throwable */ #[DeleteMapping("delete"), Permission("setting:module:delete"), OperationLog] public function delete(): ResponseInterface { return $this->service->uninstallModule($this->request->input('name')) ? $this->success() : $this->error(); } }