<?php

namespace app\admin\controller;

use app\admin\common\AdminController;
use app\admin\api\RoleApi;

/**
 * Description of Role
 *
 * @author sgq
 */
class Role extends AdminController {

    /**
     * @auth {{/role}}
     * @return type
     */
    public function index() {
        return view();
    }

    /**
     * @auth {{/role/list}}
     * @return type
     */
    public function list() {
        $name = trim($this->request->param("roleName"));
        $where = [];
        if ($name) {
            $where = [["name", "like", "%" . $name . "%"]];
        }
        $list = RoleApi::getList($where);
        return json($list);
    }

    /**
     * @auth {{/role/add}}
     * @return type
     */
    public function add() {
        return view();
    }

    /**
     * @auth {{/role/edit}}
     * @return type
     */
    public function edit() {
        return view();
    }

    /**
     * @auth {{/role/role_edit}}
     */
    public function role_edit() {
        
    }

    /**
     * @auth {{/role/role_assign}}
     * @return type
     */
    public function assign() {
        
    }

    /**
     * @auth {{/role/setAuthority}}
     */
    public function set_authority() {
        
    }

    /**
     * @auth {{/role/remove}}
     */
    public function remove() {
        
    }

}
