修改部门和岗位
This commit is contained in:
@@ -3,6 +3,9 @@ namespace catchAdmin\permissions\controller;
|
||||
|
||||
use catcher\base\CatchController;
|
||||
use catchAdmin\permissions\model\Department as DepartmentModel;
|
||||
use catcher\base\CatchRequest;
|
||||
use catcher\CatchResponse;
|
||||
use catcher\Tree;
|
||||
|
||||
class Department extends CatchController
|
||||
{
|
||||
@@ -13,23 +16,53 @@ class Department extends CatchController
|
||||
$this->department = $department;
|
||||
}
|
||||
|
||||
public function index()
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @time 2020年01月09日
|
||||
* @param CatchRequest $request
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DbException
|
||||
*/
|
||||
public function index(CatchRequest $request): \think\response\Json
|
||||
{
|
||||
|
||||
return CatchResponse::success(Tree::done($this->department->getList($request->param())));
|
||||
}
|
||||
|
||||
public function save()
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @time 2020年01月09日
|
||||
* @param CatchRequest $request
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function save(CatchRequest $request): \think\response\Json
|
||||
{
|
||||
|
||||
return CatchResponse::success($this->department->storeBy($request->post()));
|
||||
}
|
||||
|
||||
public function update()
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @time 2020年01月09日
|
||||
* @param $id
|
||||
* @param CatchRequest $request
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function update($id, CatchRequest $request): \think\response\Json
|
||||
{
|
||||
|
||||
return CatchResponse::success($this->department->updateBy($id, $request->post()));
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @time 2020年01月09日
|
||||
* @param $id
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function delete($id): \think\response\Json
|
||||
{
|
||||
|
||||
return CatchResponse::success($this->department->deleteBy($id));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user