55 lines
1.6 KiB
PHP
55 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace app\adminapi\controller\community;
|
|
|
|
use app\adminapi\controller\BaseAdminController;
|
|
use app\adminapi\lists\community\CommunityCategoryLists;
|
|
use app\adminapi\logic\community\CommunityCategoryLogic;
|
|
use app\adminapi\validate\community\CommunityCategoryValidate;
|
|
|
|
class CommunityCategoryController extends BaseAdminController
|
|
{
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new CommunityCategoryLists());
|
|
}
|
|
|
|
public function all()
|
|
{
|
|
return $this->data(CommunityCategoryLogic::all());
|
|
}
|
|
|
|
public function detail()
|
|
{
|
|
$params = (new CommunityCategoryValidate())->goCheck('detail');
|
|
return $this->data(CommunityCategoryLogic::detail($params));
|
|
}
|
|
|
|
public function add()
|
|
{
|
|
$params = (new CommunityCategoryValidate())->post()->goCheck('add');
|
|
if (CommunityCategoryLogic::add($params)) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CommunityCategoryLogic::getError());
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
$params = (new CommunityCategoryValidate())->post()->goCheck('edit');
|
|
if (CommunityCategoryLogic::edit($params)) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CommunityCategoryLogic::getError());
|
|
}
|
|
|
|
public function delete()
|
|
{
|
|
$params = (new CommunityCategoryValidate())->post()->goCheck('delete');
|
|
if (CommunityCategoryLogic::delete($params)) {
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CommunityCategoryLogic::getError());
|
|
}
|
|
}
|