/**
 * 账号管理路由分发
 *
 * @author CaiAoLin
 * @date 2017/6/2
 * @version
 */
import Express from "express";
import ManagerController from "../controllers/manager_controller";

const router = Express.Router();
const managerController = new ManagerController();

module.exports =function (app) {

    // 管理员列表action
    router.get('/', managerController.auth, managerController.init, managerController.index);
    // 修改管理员
    router.post('/modify/:id', managerController.auth, managerController.init, managerController.modify);
    // 删除管理员
    router.get('/delete/:id',managerController.auth,  managerController.init, managerController.delete);
    // 超级管理员action
    router.get('/admin', managerController.auth, managerController.init, managerController.admin);
    router.post('/admin', managerController.auth, managerController.init, managerController.adminSubmit);

    router.get('/create', managerController.create);

    app.use("/manager", router);
};