ArticleCategory.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\api\article;
  12. use think\App;
  13. use app\common\repositories\article\ArticleCategoryRepository as repository;
  14. use crmeb\basic\BaseController;
  15. /**
  16. * Class ArticleCategory
  17. * app\controller\api\article
  18. * 文章分类
  19. */
  20. class ArticleCategory extends BaseController
  21. {
  22. /**
  23. * @var repository
  24. */
  25. protected $repository;
  26. /**
  27. * StoreBrand constructor.
  28. * @param App $app
  29. * @param repository $repository
  30. */
  31. public function __construct(App $app, repository $repository)
  32. {
  33. parent::__construct($app);
  34. $this->repository = $repository;
  35. }
  36. /**
  37. * 列表
  38. * @return mixed
  39. * @throws \think\db\exception\DataNotFoundException
  40. * @throws \think\db\exception\DbException
  41. * @throws \think\db\exception\ModelNotFoundException
  42. * @author Qinii
  43. */
  44. public function lst()
  45. {
  46. return app('json')->success($this->repository->apiGetArticleCategory());
  47. }
  48. }