service = $service; } public function filterConfig() { $params = $this->valid([ "type" => "", ]); return $this->ok([ "list" => $this->service->filterConfig($params), ]); } public function home() { return $this->ok([ "banner" => $this->service->banner(), "categoryTree" => $this->service->categoryTree("home"), "hot_goods" => $this->service->hotGoods(10), "recommend_goods" => $this->service->recommendedGoods(10), ]); } public function categoryGoods() { $params = $this->valid([ "id" => "required", "page_size" => "int", "keyword" => "", "attrs" => "", ]); return $this->ok($this->service->categoryGoods($params)); } public function categoryTree() { return $this->ok([ "categoryTree" => $this->service->categoryTree("category"), ]); } public function search() { $params = $this->valid([ "keyword" => "", "attrs" => "", ]); return $this->ok($this->service->search($params)); } }