You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
601 B

5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Controller\v3;
  3. use App\Controller\BaseController;
  4. use App\Service\v3\Interfaces\CategoryServiceInterface;
  5. use Hyperf\Di\Annotation\Inject;
  6. class CategoryController extends BaseController
  7. {
  8. /**
  9. * @Inject
  10. * @var CategoryServiceInterface
  11. */
  12. protected $categoryService;
  13. /**
  14. * 获取分类页所有分类
  15. * 1、无参数
  16. * 2、远程关联获取所有分类信息
  17. * @return \Psr\Http\Message\ResponseInterface
  18. */
  19. public function all()
  20. {
  21. return $this->success(['category' => $this->categoryService->all()]);
  22. }
  23. }