<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Base;
use App\Services\Auth\AuthService;

class Permission extends Base{

    /**
     * @title 菜单列表
     *
     * @param AuthService $service
     * @return void
     */
    public function index(AuthService $service){
		$this->data['code'] = 1;
		$this->data['data'] = $service->getAuthMenu();
		return $this->data;
    }

    /**
     * @title 我的菜单及权限
     *
     * @param AuthService $service
     * @return void
     */
	public function my(AuthService $service){
		$this->data['code'] = 1;
		$this->data['data'] = ['menu' => $service->getAuthMenu(), 'permissions' => $service->getAuthPermissions()];
		return $this->data;
	}

    /**
     * @title 添加菜单
     *
     * @param AuthService $service
     * @return void
     */
    public function add(AuthService $service){
		$this->data['code'] = 1;
		$this->data['data'] = $service->getAuthMenu();
		return $this->data;
    }

    /**
     * @title 更新菜单
     *
     * @param AuthService $service
     * @return void
     */
    public function edit(AuthService $service){
		$this->data['code'] = 1;
		$this->data['data'] = $service->getAuthMenu();
		return $this->data;
    }
}
