| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace App\Http\Controllers\Admin;
- use App\Services\Common\ArticleCategoryService;
- /**
- * 文章分类管理-控制器
- * @author laravel开发员
- * @since 2020/11/11
- * Class ArticleCategoryController
- * @package App\Http\Controllers\Admin
- */
- class ArticleCategoryController extends Backend
- {
- /**
- * 构造函数
- * @author laravel开发员
- * @since 2020/11/11
- * ArticleCategoryController constructor.
- */
- public function __construct()
- {
- parent::__construct();
- $this->service = new ArticleCategoryService();
- }
- /**
- * 获取分类列表
- */
- public function index()
- {
- $pageSize = request()->get('limit', 10);
- $list = $this->service->getDataList(request()->all(), $pageSize);
- $message = array(
- "msg" => '操作成功',
- "code" => 0,
- "data" => isset($list['list']) ? $list['list'] : [],
- "count" => isset($list['total']) ? $list['total'] : 0,
- );
- return $message;
- }
- /**
- * 获取分类选项
- */
- public function options()
- {
- $list = $this->service->getOptions();
- return response()->json(['code' => 0, 'msg' => '操作成功', 'data' => $list]);
- }
- /**
- * 获取分类详情
- */
- public function info()
- {
- return $this->service->info();
- }
- /**
- * 添加或编辑分类
- */
- public function edit()
- {
- return $this->service->edit();
- }
- /**
- * 删除分类
- */
- public function delete()
- {
- return $this->service->delete();
- }
- /**
- * 设置分类状态
- */
- public function status()
- {
- return $this->service->status();
- }
- }
|