set.js 450 B

123456789101112
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const prefix = '/api/htyd';
  7. const index = 'set';
  8. const { router, controller } = app;
  9. router.get(index, `${prefix}/${index}/range`, controller[index].range);
  10. router.resources(index, `${prefix}/${index}`, controller[index]); // index、create、show、destroy
  11. router.post(index, `${prefix}/${index}/update/:id`, controller[index].update);
  12. };