service = new BannerService(); } /** * 轮播图模块 * @return \support\Response */ public function getBannerModule() { try { $raw = $this->service->getBannerModule(); $data = $this->transformData($raw, method_exists($this, 'indexFormat') ? [$this, 'indexFormat'] : null); return $this->success($data); } catch (\Throwable $e) { return $this->error($e->getMessage()); } } }