// controllers
var mainCtrl = require('../controllers/mainCtrl'),
    userCtrl = require('../controllers/userCtrl'),
    departCtrl = require('../controllers/departCtrl'),
    applyCtrl = require('../controllers/applyCtrl'),
    noticeCtrl = require('../controllers/noticeCtrl');

module.exports = function (app) {
    // ===================设置路由===================
    // PS: :id 可以在 req.params.id获取到
    //     POST的数据经过body-parser处理，可直接通过req.body.xxx获取
    // 登陆控制
    app.get('/', mainCtrl.index);
    app.post('/login', mainCtrl.login);
    app.get('/logout', mainCtrl.logout);

    // 用户控制
    app.get('/user', userCtrl.index);
    app.post('/user/add', userCtrl.add);
    app.get('/user/:id', userCtrl.list);
    app.post('/user/:id/edit', userCtrl.edit);
    app.get('/user/:id/delete', userCtrl.delete);

    // 部门控制
    app.get('/depart', departCtrl.index);
    app.post('/depart/add', departCtrl.add);
    app.get('/depart/:id', departCtrl.list);
    app.post('/depart/:id/edit', departCtrl.edit);
    app.get('/depart/:id/delete', departCtrl.delete);

    // 申请控制
    app.get('/apply', applyCtrl.index);
    app.post('/apply/add', applyCtrl.add);
    app.get('/apply/:id', applyCtrl.list);
    app.post('/apply/:id/edit', applyCtrl.edit);
    app.get('/apply/:id/delete', applyCtrl.delete);

    // 通知控制
    app.get('/notice', noticeCtrl.index);
    app.post('/notice/add', noticeCtrl.add);
    app.get('/notice/:id', noticeCtrl.list);
    app.post('/notice/:id/edit', noticeCtrl.edit);
    app.get('/notice/:id/delete', noticeCtrl.delete);

    // ==============================================

    // 通过通配符处理没有经过路由的所有404页面，必须放在上边所有路由最后
    app.get('*', function(req, res){
        res.send('404');
    });
};
@@ -709,34 +709,33 @@
 list);%0A    app.p
-os
+u
 t('/user/:id/edi
@@ -754,35 +754,38 @@
 .edit);%0A    app.
-g
+del
 et
+e
 ('/user/:id/dele
@@ -953,34 +953,33 @@
 list);%0A    app.p
-os
+u
 t('/depart/:id/e
@@ -1002,35 +1002,38 @@
 .edit);%0A    app.
-g
+del
 et
+e
 ('/depart/:id/de
@@ -1199,34 +1199,33 @@
 list);%0A    app.p
-os
+u
 t('/apply/:id/ed
@@ -1246,35 +1246,38 @@
 .edit);%0A    app.
-g
+del
 et
+e
 ('/apply/:id/del
@@ -1447,34 +1447,33 @@
 list);%0A    app.p
-os
+u
 t('/notice/:id/e
@@ -1496,35 +1496,38 @@
 .edit);%0A    app.
-g
+del
 et
+e
 ('/notice/:id/de

make it RESTful