dataLists(new AdminLists()); } #[ ApiDoc\Title("添加管理员"), ApiDoc\url('/store/auth/admin/add'), ApiDoc\Method('GET'), ApiDoc\NotHeaders(), ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), ApiDoc\ResponseSuccess("data", type: "array"), ] public function add() { $params = (new AdminValidate())->post()->goCheck('add'); $result = AdminLogic::add($params); if (true === $result) { return $this->success('操作成功', [], 1, 1); } return $this->fail(AdminLogic::getError()); } #[ ApiDoc\Title("编辑管理员"), ApiDoc\url('/store/auth/admin/edit'), ApiDoc\Method('GET'), ApiDoc\NotHeaders(), ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), ApiDoc\ResponseSuccess("data", type: "array"), ] public function edit() { $params = (new AdminValidate())->post()->goCheck('edit'); $result = AdminLogic::edit($params); if (true === $result) { return $this->success('操作成功', [], 1, 1); } return $this->fail(AdminLogic::getError()); } #[ ApiDoc\Title("删除管理员"), ApiDoc\url('/store/auth/admin/delete'), ApiDoc\Method('GET'), ApiDoc\NotHeaders(), ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), ApiDoc\ResponseSuccess("data", type: "array"), ] public function delete() { $params = (new AdminValidate())->post()->goCheck('delete'); $result = AdminLogic::delete($params); if (true === $result) { return $this->success('操作成功', [], 1, 1); } return $this->fail(AdminLogic::getError()); } #[ ApiDoc\Title("查看管理员详情"), ApiDoc\url('/store/auth/admin/detail'), ApiDoc\Method('GET'), ApiDoc\NotHeaders(), ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), ApiDoc\ResponseSuccess("data", type: "array"), ] public function detail() { $params = (new AdminValidate())->goCheck('detail'); $result = AdminLogic::detail($params); return $this->data($result); } #[ ApiDoc\Title("获取当前管理员信息"), ApiDoc\url('/store/auth/admin/mySelf'), ApiDoc\Method('GET'), ApiDoc\NotHeaders(), ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), ApiDoc\ResponseSuccess("data", type: "array"), ] public function mySelf() { $result = AdminLogic::detail(['id' => $this->adminId], 'auth'); return $this->data($result); } #[ ApiDoc\Title("编辑超级管理员信息"), ApiDoc\url('/store/auth/admin/editSelf'), ApiDoc\Method('GET'), ApiDoc\NotHeaders(), ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), ApiDoc\ResponseSuccess("data", type: "array"), ] public function editSelf() { $params = (new editSelfValidate())->post()->goCheck('', ['admin_id' => $this->adminId]); $result = AdminLogic::editSelf($params); return $this->success('操作成功', [], 1, 1); } }