CommunityCategory.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 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\community;
  12. use crmeb\basic\BaseController;
  13. use crmeb\traits\CategoresRepository;
  14. use think\App;
  15. use app\validate\admin\StoreCategoryValidate;
  16. use app\common\repositories\community\CommunityCategoryRepository as repository;
  17. use think\exception\ValidateException;
  18. class CommunityCategory extends BaseController
  19. {
  20. /**
  21. * @var CommunityCategoryRepository
  22. */
  23. protected $repository;
  24. /**
  25. * User constructor.
  26. * @param App $app
  27. * @param $repository
  28. */
  29. public function __construct(App $app, repository $repository)
  30. {
  31. parent::__construct($app);
  32. $this->repository = $repository;
  33. if (!systemConfig('community_status') ) throw new ValidateException('未开启社区功能');
  34. }
  35. /**
  36. * TODO
  37. * @return \think\response\Json
  38. * @author Qinii
  39. * @day 10/27/21
  40. */
  41. public function lst()
  42. {
  43. return app('json')->success($this->repository->getApiList());
  44. }
  45. }