notify_route.js 1.0 KB

1234567891011121314151617181920212223242526
  1. /**
  2. * 通知相关路由
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/6/7
  6. * @version
  7. */
  8. import Express from "express";
  9. import NotifyController from "../controllers/notify_controller";
  10. const router = Express.Router();
  11. const notifyController = new NotifyController();
  12. module.exports =function (app) {
  13. // action定义区域
  14. router.get('/', notifyController.auth, notifyController.init, notifyController.index);
  15. router.get('/add', notifyController.auth, notifyController.init, notifyController.add);
  16. router.get('/modify/:id', notifyController.auth, notifyController.init, notifyController.modify);
  17. router.get('/delete/:id', notifyController.auth, notifyController.init, notifyController.delete);
  18. router.get('/release/:id', notifyController.auth, notifyController.init, notifyController.release);
  19. router.post('/add', notifyController.auth, notifyController.init, notifyController.addMessage);
  20. router.post('/modify/:id', notifyController.auth, notifyController.init, notifyController.modifyMessage);
  21. app.use("/notify", router);
  22. };