* This source file is subject to the license under the project that is bundled. */ namespace App\Controller\Admin; //use App\Controller\AbstractController; //use App\Exception\BusinessException; //use App\Logic\Admin\MenuLogic; //use App\Request\System\Menu\CreateMenuRequest; //use App\Request\System\Menu\UpdateMenuRequest; //use Hyperf\Di\Annotation\Inject; class MenuController extends AbstractController { // /** // * @Inject // * @var MenuLogic // */ // private $logic; // // public function all() // { // $menus = $this->logic->getAllMenus(); // // return $this->success($menus); // } // // public function get(int $id) // { // $menu = $this->logic->get($id); // // return $this->success($menu); // } // // public function update(int $id, UpdateMenuRequest $request) // { // $pid = $request->post('pid', 0); // $title = $request->post('title', ''); // $icon = $request->post('icon', ''); // $type = (int) $request->post('type', 0); // $name = $request->post('name', ''); // $path = $request->post('path', ''); // $component = $request->post('component', ''); // $api = $request->post('api'); // $isLink = $request->post('is_link', ''); // $action = $request->post('action', ''); // $sort = (int) $request->post('sort', 0); // $status = (int) $request->post('status', 0); // // $res = $this->logic->update( // $id, // $pid, // $title, // $icon, // $type, // $name, // $path, // $component, // $api, // $isLink, // $action, // $sort, // $status // ); // // return $this->success($res); // } // // public function create(CreateMenuRequest $request) // { // $pid = $request->post('pid', 0); // $title = $request->post('title', ''); // $icon = $request->post('icon', ''); // $type = (int) $request->post('type', 0); // $name = $request->post('name', ''); // $path = $request->post('path', ''); // $component = $request->post('component', ''); // $api = $request->post('api'); // $isLink = (int) $request->post('is_link', 0); // $action = $request->post('action', ''); // $sort = (int) $request->post('sort', 0); // $status = (int) $request->post('status', 0); // // $res = $this->logic->create( // $pid, // $title, // $icon, // $type, // $name, // $path, // $component, // $api, // $isLink, // $action, // $sort, // $status // ); // // return $this->success($res); // } // // public function delete(int $id) // { // $res = $this->logic->delete($id); // if ($res !== 1) { // throw new BusinessException('删除失败'); // } // // return $this->success($res); // } }